From f2d8be239f471bd24207883d07509d4a39ae73c0 Mon Sep 17 00:00:00 2001 From: leitner Date: Fri, 5 Sep 2003 21:12:24 +0000 Subject: [PATCH] oops, forgot ! --- io/io_tryreadtimeout.c | 2 +- io/io_trywritetimeout.c | 2 +- test/io4.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/io/io_tryreadtimeout.c b/io/io_tryreadtimeout.c index 5c41bcb..e123703 100644 --- a/io/io_tryreadtimeout.c +++ b/io/io_tryreadtimeout.c @@ -10,7 +10,7 @@ int64 io_tryreadtimeout(int64 d,char* buf,int64 len) { tai6464 x; io_entry* e=array_get(&io_fds,sizeof(io_entry),d); taia_now(&x); - if (taia_less(&x,&e->timeout)) { + if (!taia_less(&x,&e->timeout)) { errno=ETIMEDOUT; r=-2; } diff --git a/io/io_trywritetimeout.c b/io/io_trywritetimeout.c index 75b4894..e0761c5 100644 --- a/io/io_trywritetimeout.c +++ b/io/io_trywritetimeout.c @@ -10,7 +10,7 @@ int64 io_trywritetimeout(int64 d,const char* buf,int64 len) { tai6464 x; io_entry* e=array_get(&io_fds,sizeof(io_entry),d); taia_now(&x); - if (taia_less(&x,&e->timeout)) { + if (!taia_less(&x,&e->timeout)) { errno=ETIMEDOUT; r=-2; } diff --git a/test/io4.c b/test/io4.c index 7194356..62fa6fc 100644 --- a/test/io4.c +++ b/test/io4.c @@ -17,6 +17,7 @@ main() { taia_addsec(&t,&t,1); if (!io_fd(pfd[0])) return 111; io_timeout(pfd[0],t); + sleep(2); if ((r=io_tryreadtimeout(pfd[0],buf,sizeof buf))!=-2) { buffer_puts(buffer_2,"io_tryreadtimeout returned "); buffer_putlonglong(buffer_2,r);