From a05d9e72615954aa2d4db1df481539ff39c74266 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 18 May 2006 01:45:18 +0000 Subject: r15675: Man pages say never look at the fd_set after a select if it returned -1 (treat as undefined). Ensure we obey this. Jeremy. (This used to be commit 256ae3a16bcafe70cc1a00496681c709380e4fc3) --- source3/nsswitch/winbindd.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source3/nsswitch/winbindd.c') diff --git a/source3/nsswitch/winbindd.c b/source3/nsswitch/winbindd.c index 06b8b93543..cc904c3209 100644 --- a/source3/nsswitch/winbindd.c +++ b/source3/nsswitch/winbindd.c @@ -769,10 +769,14 @@ static void process_loop(void) 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 @@ static void process_loop(void) exit(1); } + /* selret > 0 */ + ev = fd_events; while (ev != NULL) { struct fd_event *next = ev->next; -- cgit