summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-05-18 01:45:18 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:17:06 -0500
commita05d9e72615954aa2d4db1df481539ff39c74266 (patch)
tree29e6287550672b357bf536103b43e5c2365ed4bb /source3/nsswitch/winbindd.c
parentf895fcf1090c0400981587c36d040629b858deec (diff)
downloadsamba-a05d9e72615954aa2d4db1df481539ff39c74266.tar.gz
samba-a05d9e72615954aa2d4db1df481539ff39c74266.tar.bz2
samba-a05d9e72615954aa2d4db1df481539ff39c74266.zip
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)
Diffstat (limited to 'source3/nsswitch/winbindd.c')
-rw-r--r--source3/nsswitch/winbindd.c10
1 files changed, 8 insertions, 2 deletions
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;