From 7ae9a22df20ad86cdd33d94713f616a11f478e5f Mon Sep 17 00:00:00 2001 From: Daniel Eischen Date: Sun, 7 Oct 2001 02:34:43 +0000 Subject: Limit maximum poll interval to 60 seconds. This prevents an overflow from occurring when converting from a timeval/timespec to a timeout in milliseconds. Submitted by: dwmalone --- lib/libpthread/thread/thr_kern.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/libpthread') diff --git a/lib/libpthread/thread/thr_kern.c b/lib/libpthread/thread/thr_kern.c index 9d317eda6ccaf..ec4c233fef083 100644 --- a/lib/libpthread/thread/thr_kern.c +++ b/lib/libpthread/thread/thr_kern.c @@ -716,6 +716,9 @@ thread_kern_poll(int wait_reqd) */ timeout_ms = INFTIM; } + else if (pthread->wakeup_time.tv_sec - ts.tv_sec > 60000) + /* Limit maximum timeout to prevent rollover. */ + timeout_ms = 60000; else { /* * Calculate the time left for the next thread to -- cgit v1.3