浏览代码

make sys_poll() wait at least timeout ms

schedule_timeout(jiffies) waits for at least jiffies - 1.  Add 1 jiffie to
the timeout_jiffies calculated in sys_poll() to wait at least
timeout_msecs, like poll() manpage says.

Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Karsten Wiese 18 年之前
父节点
当前提交
844fcc5396
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      fs/select.c

+ 1 - 1
fs/select.c

@@ -739,7 +739,7 @@ asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds,
 			timeout_jiffies = -1;
 			timeout_jiffies = -1;
 		else
 		else
 #endif
 #endif
-			timeout_jiffies = msecs_to_jiffies(timeout_msecs);
+			timeout_jiffies = msecs_to_jiffies(timeout_msecs) + 1;
 	} else {
 	} else {
 		/* Infinite (< 0) or no (0) timeout */
 		/* Infinite (< 0) or no (0) timeout */
 		timeout_jiffies = timeout_msecs;
 		timeout_jiffies = timeout_msecs;