diff --git a/io/io_nonblock.c b/io/io_nonblock.c index 3866018..69e1cfb 100644 --- a/io/io_nonblock.c +++ b/io/io_nonblock.c @@ -5,6 +5,6 @@ void io_nonblock(int64 d) { io_entry* e=array_get(&io_fds,sizeof(io_entry),d); - fcntl(d,F_SETFL,fcntl(d,F_GETFL,0) | O_NDELAY); - if (e) e->nonblock=1; + if (fcntl(d,F_SETFL,fcntl(d,F_GETFL,0) | O_NDELAY)==0) + if (e) e->nonblock=1; }