svn commit: samba r15675 - in branches/SAMBA_3_0/source/nsswitch: .

jra at samba.org jra at samba.org
Thu May 18 01:45:20 GMT 2006


Author: jra
Date: 2006-05-18 01:45:18 +0000 (Thu, 18 May 2006)
New Revision: 15675

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

Log:
Man pages say never look at the fd_set after a select
if it returned -1 (treat as undefined). Ensure we obey
this.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/nsswitch/winbindd.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd.c	2006-05-18 01:45:11 UTC (rev 15674)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd.c	2006-05-18 01:45:18 UTC (rev 15675)
@@ -769,10 +769,14 @@
         
 	selret = sys_select(maxfd + 1, &r_fds, &w_fds, NULL, &timeout);
 
-	if (selret == 0)
+	if (selret == 0) {
 		goto no_fds_ready;
+	}
 
-	if ((selret == -1 && errno != EINTR) || selret == 0) {
+	if (selret == -1) {
+		if (errno == EINTR) {
+			goto no_fds_ready;
+		}
 
 		/* Select error, something is badly wrong */
 
@@ -780,6 +784,8 @@
 		exit(1);
 	}
 
+	/* selret > 0 */
+
 	ev = fd_events;
 	while (ev != NULL) {
 		struct fd_event *next = ev->next;



More information about the samba-cvs mailing list