patch-2.4.0-test11 linux/fs/select.c

Next file: linux/fs/smbfs/cache.c
Previous file: linux/fs/ramfs/inode.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test10/linux/fs/select.c linux/fs/select.c
@@ -382,13 +382,14 @@
 static int do_poll(unsigned int nfds, unsigned int nchunks, unsigned int nleft, 
 	struct pollfd *fds[], poll_table *wait, long timeout)
 {
-	int count = 0;
+	int count;
 	poll_table* pt = wait;
 
 	for (;;) {
 		unsigned int i;
 
 		set_current_state(TASK_INTERRUPTIBLE);
+		count = 0;
 		for (i=0; i < nchunks; i++)
 			do_pollfd(POLLFD_PER_PAGE, fds[i], &pt, &count);
 		if (nleft)
@@ -396,9 +397,9 @@
 		pt = NULL;
 		if (count || !timeout || signal_pending(current))
 			break;
-		if(wait->error) {
-			return wait->error;
-		}
+		count = wait->error;
+		if (count)
+			break;
 		timeout = schedule_timeout(timeout);
 	}
 	current->state = TASK_RUNNING;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)