diff -urN linux-2.4.32-wt1-0/fs/eventpoll.c linux-2.4.32-wt1-1/fs/eventpoll.c --- linux-2.4.32-wt1-0/fs/eventpoll.c 2005-12-04 22:25:32.000000000 +0100 +++ linux-2.4.32-wt1-1/fs/eventpoll.c 2005-12-04 22:26:48.000000000 +0100 @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -1571,12 +1572,12 @@ wait_queue_t wait; /* - * Calculate the timeout by checking for the "infinite" value ( -1 ) - * and the overflow condition. The passed timeout is in milliseconds, - * that why (t * HZ) / 1000. + * Calculate the timeout by checking for the "infinite" value ( < 0 ) + * and the overflow condition. The passed timeout is in milliseconds. */ - jtimeout = timeout == -1 || timeout > (MAX_SCHEDULE_TIMEOUT - 1000) / HZ ? - MAX_SCHEDULE_TIMEOUT: (timeout * HZ + 999) / 1000; + if (unlikely(timeout < 0 || + (jtimeout = msecs_to_jiffies(timeout)) >= MAX_JIFFY_OFFSET)) + jtimeout = MAX_SCHEDULE_TIMEOUT; retry: write_lock_irqsave(&ep->lock, flags);