lkml.org 
[lkml]   [2005]   [Sep]   [23]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateFri, 23 Sep 2005 11:13:30 -0700 (PDT)
FromDavide Libenzi <>
Subject[patch] sys_epoll_wait() timeout saga ...
The sys_epoll_wait() function was not handling correctly negative timeouts 
(besides -1), and like sys_poll(), was comparing millisec to secs in 
testing the upper timeout limit.


Signed-off-by: Davide Libenzi <davidel@xmailserver.org>


- Davide
--- a/fs/eventpoll.c	2005-09-23 10:56:57.000000000 -0700
+++ b/fs/eventpoll.c	2005-09-23 11:00:06.000000000 -0700
@@ -1507,7 +1507,7 @@
 	 * and the overflow condition. The passed timeout is in milliseconds,
 	 * that why (t * HZ) / 1000.
 	 */
-	jtimeout = timeout == -1 || timeout > (MAX_SCHEDULE_TIMEOUT - 1000) / HZ ?
+	jtimeout = timeout < 0 || (timeout / 1000) >= (MAX_SCHEDULE_TIMEOUT / HZ) ?
 		MAX_SCHEDULE_TIMEOUT: (timeout * HZ + 999) / 1000;
 
 retry:
\
 
 \ /
  Last update: 2005-09-23 18:13    [from the cache]
©2003-2008