diff -urN linux-2.4.32-wt1-1/fs/select.c linux-2.4.32-wt1-2/fs/select.c --- linux-2.4.32-wt1-1/fs/select.c 2005-12-04 22:25:28.000000000 +0100 +++ linux-2.4.32-wt1-2/fs/select.c 2005-12-04 22:28:06.000000000 +0100 @@ -20,6 +20,7 @@ #include /* for STICKY_TIMEOUTS */ #include #include +#include #include @@ -433,11 +434,10 @@ return -EINVAL; if (timeout) { - /* Careful about overflow in the intermediate values */ - if ((unsigned long) timeout < MAX_SCHEDULE_TIMEOUT / HZ) - timeout = (unsigned long)(timeout*HZ+999)/1000+1; - else /* Negative or overflow */ - timeout = MAX_SCHEDULE_TIMEOUT; + if (unlikely(timeout < 0 || + (timeout = msecs_to_jiffies(timeout)) >= + MAX_JIFFY_OFFSET)) + timeout = MAX_SCHEDULE_TIMEOUT; } poll_initwait(&table);