From 519b512cc31716e1c6bd643d1b2677f8821a869c Mon Sep 17 00:00:00 2001 From: leitner Date: Fri, 26 Sep 2003 16:14:03 +0000 Subject: [PATCH] kqueue does not like timeout==-1 but wants a NULL pointer to wait indefinitely --- io/io_waituntil2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io/io_waituntil2.c b/io/io_waituntil2.c index 996a741..184effd 100644 --- a/io/io_waituntil2.c +++ b/io/io_waituntil2.c @@ -47,7 +47,7 @@ int64 io_waituntil2(int64 milliseconds) { int n; struct timespec ts; ts.tv_sec=milliseconds/1000; ts.tv_nsec=(milliseconds%1000)*1000000; - if ((n=kevent(io_master,0,0,y,100,&ts))==-1) return -1; + if ((n=kevent(io_master,0,0,y,100,timeout?&ts:0))==-1) return -1; for (i=n-1; i>=0; --i) { io_entry* e=array_get(&io_fds,sizeof(io_entry),y[--n].ident); if (e) {