Messages in this thread Patch in this message | | | Date | Tue, 06 Jul 1999 17:08:22 -0400 | From | Dong Liu <> | Subject | Patches to make select, poll and nanosleep calculate timeout in the same way. |
| |
Hi Linus,
Here are two small patches (against 2.2.10) to make select, poll and nanosleep calculate timeout jiffies in the same way.
Dong--- linux/fs/select.c.save Tue Jul 6 16:45:28 1999 +++ linux/fs/select.c Tue Jul 6 16:51:43 1999 @@ -389,7 +389,7 @@ if (timeout) { /* Carefula about overflow in the intermediate values */ if ((unsigned long) timeout < MAX_SCHEDULE_TIMEOUT / HZ) - timeout = (unsigned long)(timeout*HZ+999)/1000+1; + timeout = (unsigned long)(timeout*HZ+999)/1000; else /* Negative or overflow */ timeout = MAX_SCHEDULE_TIMEOUT; } --- linux/kernel/sched.c.save Fri Jul 2 13:40:29 1999 +++ linux/kernel/sched.c Tue Jul 6 16:51:54 1999 @@ -1921,7 +1921,7 @@ return 0; } - expire = timespec_to_jiffies(&t) + (t.tv_sec || t.tv_nsec); + expire = timespec_to_jiffies(&t); current->state = TASK_INTERRUPTIBLE; expire = schedule_timeout(expire); | |