All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] Make epoll_wait() handle negative timeouts as MAX_SCHEDULE_TIMEOUT ...
@ 2005-09-23 17:37 Davide Libenzi
  2005-09-23 17:42 ` Nish Aravamudan
  0 siblings, 1 reply; 3+ messages in thread
From: Davide Libenzi @ 2005-09-23 17:37 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Andrew Morton

[-- Attachment #1: Type: TEXT/PLAIN, Size: 198 bytes --]


As reported by Vadim Lobanov, epoll_wait() did not handle correctly 
timeouts <0 (only the -1 case was MAX_SCHEDULE_TIMEOUT'd).


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


- Davide

[-- Attachment #2: Type: TEXT/PLAIN, Size: 472 bytes --]

--- a/fs/eventpoll.c	2005-09-23 10:06:45.000000000 -0700
+++ b/fs/eventpoll.c	2005-09-23 10:09:35.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 > (MAX_SCHEDULE_TIMEOUT - 1000) / HZ ?
 		MAX_SCHEDULE_TIMEOUT: (timeout * HZ + 999) / 1000;
 
 retry:

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-09-23 18:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-23 17:37 [patch] Make epoll_wait() handle negative timeouts as MAX_SCHEDULE_TIMEOUT Davide Libenzi
2005-09-23 17:42 ` Nish Aravamudan
2005-09-23 18:04   ` Davide Libenzi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.