Always increment even if the read fails (otherwise we spin if we hit the kernel bug...
[ira/wip.git] / source3 / lib / select.c
index c654a4a02ca0d2113882569f19c7c4dcc9328b9c..396ecb5dd6b0bce745c500cdb6656915c6f7a5d4 100644 (file)
@@ -98,7 +98,10 @@ int sys_select(int maxfd, fd_set *fds,struct timeval *tval)
 
        while (pipe_written != pipe_read) {
                char c;
-               if (read(select_pipe[0], &c, 1) == 1) pipe_read++;
+               /* Due to the linux kernel bug in 2.0.x, we
+                * always increment here even if the read failed... */
+               read(select_pipe[0], &c, 1);
+               pipe_read++;
        }
 
        errno = saved_errno;