svn commit: samba r24629 - in branches: SAMBA_3_0_25/source/nsswitch SAMBA_3_2/source/nsswitch SAMBA_3_2_0/source/nsswitch SAMBA_4_0/source/nsswitch

obnox at samba.org obnox at samba.org
Wed Aug 22 13:51:45 GMT 2007


Author: obnox
Date: 2007-08-22 13:51:44 +0000 (Wed, 22 Aug 2007)
New Revision: 24629

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=24629

Log:
Make read_sock return the total number of bytes read instead
of the number of bytes read in the last of possibly several
read calls.

This was noted by Metze.

Michael


Modified:
   branches/SAMBA_3_0_25/source/nsswitch/wb_common.c
   branches/SAMBA_3_2/source/nsswitch/wb_common.c
   branches/SAMBA_3_2_0/source/nsswitch/wb_common.c
   branches/SAMBA_4_0/source/nsswitch/wb_common.c


Changeset:
Modified: branches/SAMBA_3_0_25/source/nsswitch/wb_common.c
===================================================================
--- branches/SAMBA_3_0_25/source/nsswitch/wb_common.c	2007-08-22 12:45:07 UTC (rev 24628)
+++ branches/SAMBA_3_0_25/source/nsswitch/wb_common.c	2007-08-22 13:51:44 UTC (rev 24629)
@@ -422,7 +422,7 @@
 
 static int read_sock(void *buffer, int count)
 {
-	int result = 0, nread = 0;
+	int nread = 0;
 	int total_time = 0, selret;
 
 	if (winbindd_fd == -1) {
@@ -463,7 +463,7 @@
 			
 			/* Do the Read */
 			
-			result = read(winbindd_fd, (char *)buffer + nread, 
+			int result = read(winbindd_fd, (char *)buffer + nread, 
 			      count - nread);
 			
 			if ((result == -1) || (result == 0)) {
@@ -481,7 +481,7 @@
 		}
 	}
 	
-	return result;
+	return nread;
 }
 
 /* Read reply */

Modified: branches/SAMBA_3_2/source/nsswitch/wb_common.c
===================================================================
--- branches/SAMBA_3_2/source/nsswitch/wb_common.c	2007-08-22 12:45:07 UTC (rev 24628)
+++ branches/SAMBA_3_2/source/nsswitch/wb_common.c	2007-08-22 13:51:44 UTC (rev 24629)
@@ -420,7 +420,7 @@
 
 static int read_sock(void *buffer, int count)
 {
-	int result = 0, nread = 0;
+	int nread = 0;
 	int total_time = 0, selret;
 
 	if (winbindd_fd == -1) {
@@ -461,7 +461,7 @@
 			
 			/* Do the Read */
 			
-			result = read(winbindd_fd, (char *)buffer + nread, 
+			int result = read(winbindd_fd, (char *)buffer + nread, 
 			      count - nread);
 			
 			if ((result == -1) || (result == 0)) {
@@ -479,7 +479,7 @@
 		}
 	}
 	
-	return result;
+	return nread;
 }
 
 /* Read reply */

Modified: branches/SAMBA_3_2_0/source/nsswitch/wb_common.c
===================================================================
--- branches/SAMBA_3_2_0/source/nsswitch/wb_common.c	2007-08-22 12:45:07 UTC (rev 24628)
+++ branches/SAMBA_3_2_0/source/nsswitch/wb_common.c	2007-08-22 13:51:44 UTC (rev 24629)
@@ -420,7 +420,7 @@
 
 static int read_sock(void *buffer, int count)
 {
-	int result = 0, nread = 0;
+	int nread = 0;
 	int total_time = 0, selret;
 
 	if (winbindd_fd == -1) {
@@ -461,7 +461,7 @@
 			
 			/* Do the Read */
 			
-			result = read(winbindd_fd, (char *)buffer + nread, 
+			int result = read(winbindd_fd, (char *)buffer + nread, 
 			      count - nread);
 			
 			if ((result == -1) || (result == 0)) {
@@ -479,7 +479,7 @@
 		}
 	}
 	
-	return result;
+	return nread;
 }
 
 /* Read reply */

Modified: branches/SAMBA_4_0/source/nsswitch/wb_common.c
===================================================================
--- branches/SAMBA_4_0/source/nsswitch/wb_common.c	2007-08-22 12:45:07 UTC (rev 24628)
+++ branches/SAMBA_4_0/source/nsswitch/wb_common.c	2007-08-22 13:51:44 UTC (rev 24629)
@@ -421,7 +421,7 @@
 
 static int read_sock(void *buffer, int count)
 {
-	int result = 0, nread = 0;
+	int nread = 0;
 	int total_time = 0, selret;
 
 	/* Read data from socket */
@@ -458,7 +458,7 @@
 			
 			/* Do the Read */
 			
-			result = read(winbindd_fd, (char *)buffer + nread, 
+			int result = read(winbindd_fd, (char *)buffer + nread, 
 			      count - nread);
 			
 			if ((result == -1) || (result == 0)) {
@@ -476,7 +476,7 @@
 		}
 	}
 	
-	return result;
+	return nread;
 }
 
 /* Read reply */



More information about the samba-cvs mailing list