sched: Use (0,0) as the timeval for a minimal delay.
authorAndre Noll <maan@systemlinux.org>
Thu, 21 Jul 2011 17:18:41 +0000 (19:18 +0200)
committerAndre Noll <maan@systemlinux.org>
Sat, 30 Jul 2011 18:27:55 +0000 (20:27 +0200)
The select(2) man page says:

If both fields of the timeval structure are zero,
then select() returns immediately.

This is exactly what is desired for sched_min_delay().

sched.c

diff --git a/sched.c b/sched.c
index 8baed4962d9e5dfbf2cad170b1c38d2d42b123b3..8648811d9f777a336864dbb7264db417ef648d73 100644 (file)
--- a/sched.c
+++ b/sched.c
@@ -258,8 +258,7 @@ char *get_task_list(void)
  */
 void sched_min_delay(struct sched *s)
 {
  */
 void sched_min_delay(struct sched *s)
 {
-       s->select_timeout.tv_sec = 0;
-       s->select_timeout.tv_usec = 1;
+       s->select_timeout.tv_sec = s->select_timeout.tv_usec = 0;
 }
 
 /**
 }
 
 /**