patch-2.4.5 linux/fs/select.c
Next file: linux/fs/smbfs/ChangeLog
Previous file: linux/fs/reiserfs/prints.c
Back to the patch index
Back to the overall index
-  Lines: 13
 -  Date:
Wed May 16 10:31:27 2001
 -  Orig file: 
v2.4.4/linux/fs/select.c
 -  Orig date: 
Fri Feb  9 11:29:44 2001
 
diff -u --recursive --new-file v2.4.4/linux/fs/select.c linux/fs/select.c
@@ -414,8 +414,11 @@
 	int nchunks, nleft;
 
 	/* Do a sanity check on nfds ... */
-	if (nfds > current->files->max_fds)
+	if (nfds > NR_OPEN)
 		return -EINVAL;
+
+	if (nfds > current->files->max_fds)
+		nfds = current->files->max_fds;
 
 	if (timeout) {
 		/* Careful about overflow in the intermediate values */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)