Browse Source

oops, forgot !

master
Felix von Leitner 18 years ago
parent
commit
28c1c46cad
  1. 2
      io/io_tryreadtimeout.c
  2. 2
      io/io_trywritetimeout.c
  3. 1
      test/io4.c

2
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;
}

2
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;
}

1
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);

Loading…
Cancel
Save