Patches to make select, poll and nanosleep calculate timeout in the same

Dong Liu (dongliu@lucent.com)
Tue, 06 Jul 1999 17:08:22 -0400


This is a multi-part message in MIME format.
--------------D8174A53A2438E698DDF8C2F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

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
--------------D8174A53A2438E698DDF8C2F
Content-Type: text/plain; charset=us-ascii;
name="timeout.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="timeout.diff"

--- 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);

--------------D8174A53A2438E698DDF8C2F--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/