summaryrefslogtreecommitdiff
path: root/lib/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/thread.c')
-rw-r--r--lib/thread.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/thread.c b/lib/thread.c
index 406eddc9e6..de7066bb82 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -1203,6 +1203,12 @@ thread_fetch (struct thread_master *m, struct thread *fetch)
timer_wait = timer_wait_bg;
}
+ if (timer_wait && timer_wait->tv_sec < 0)
+ {
+ timerclear(&timer_val);
+ timer_wait = &timer_val;
+ }
+
num = fd_select (m, FD_SETSIZE, &readfd, &writefd, &exceptfd, timer_wait);
/* Signals should get quick treatment */