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 */