lkml.org 
[lkml]   [1999]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectBug, bug fix, and patch to sys_select(); where do I send this?
Date
Hi,

When select() is fed a negative timeout value, it accepts it and passes it
on to the scheduler, with printk()'s a warning message; however, the syscall
returns to the calling program with no error.

I think either (a) it shouldn't log the warning message, or (b) it should
return an error to the caller. The online Unix98 spec is ambiguous.
Consensus, and other operating systems, favor (b). The rather trivial patch
(relative to 2.2.0-pre4) and the end of this message implements this change.

I have a meta-question: where do I send this sort of trivial thing? It
matters to me because some broken program on my machine was causing these
messages; I posted about the problem with very little reply; but I feel
silly sending something this trivial to Linus (and even if I wanted to,
I'm not sure how what e-mail address to use; the MAINTAINERS file doesn't
list one).

Dan

--- linux/fs/select.c.orig Sun Nov 22 10:08:50 1998
+++ linux/fs/select.c Sun Jan 3 15:46:49 1999
@@ -224,6 +224,11 @@
if ((unsigned long) sec < MAX_SELECT_SECONDS) {
timeout = ROUND_UP(usec, 1000000/HZ);
timeout += sec * (unsigned long) HZ;
+
+ if (timeout < 0) {
+ ret = -EINVAL;
+ goto out_nofds;
+ }
}
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:49    [W:0.071 / U:0.840 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site