diff --git a/CHANGES b/CHANGES index 8a91078..d1f5a4e 100644 --- a/CHANGES +++ b/CHANGES @@ -5,6 +5,7 @@ the integer scan routines should only write *dest if they actually scanned something io_sendfile and iob_send should return -1 to -3 just like io_trywrite + make io_waituntil actually take an "until", not a "how long" 0.16: add buffer_fromsa (make buffer from stralloc) diff --git a/io/io_timeouted.c b/io/io_timeouted.c index 37f4cae..4f72fe4 100644 --- a/io/io_timeouted.c +++ b/io/io_timeouted.c @@ -10,8 +10,9 @@ int64 io_timeouted() { if (ptr>=alen) ptr=0; e=array_get(&io_fds,sizeof(io_entry),ptr); if (!e) return -1; - for (;ptrinuse && taia_less(&e->timeout,&now)) + for (;ptrinuse && e->timeout.sec.x && taia_less(&e->timeout,&now)) return ptr; + } return -1; } diff --git a/io/io_waituntil.c b/io/io_waituntil.c index 3f16e61..2bc4d72 100644 --- a/io/io_waituntil.c +++ b/io/io_waituntil.c @@ -7,9 +7,10 @@ void io_waituntil(tai6464 t) { uint64 x,y; - tai6464 now; + tai6464 now,diff; taia_now(&now); - if (!umult64(now.sec.x,1000,&x) || (y=x+now.nano/10000000)