svn commit: samba r15674 - in trunk/source/nsswitch: .

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


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

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

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:
   trunk/source/nsswitch/winbindd.c


Changeset:
Modified: trunk/source/nsswitch/winbindd.c
===================================================================
--- trunk/source/nsswitch/winbindd.c	2006-05-18 01:30:03 UTC (rev 15673)
+++ trunk/source/nsswitch/winbindd.c	2006-05-18 01:45:11 UTC (rev 15674)
@@ -770,10 +770,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 */
 
@@ -781,6 +785,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