From 27ffe564a769f15e4970da024e548003afc8eb07 Mon Sep 17 00:00:00 2001 From: leitner Date: Fri, 24 Oct 2003 18:57:46 +0000 Subject: [PATCH] set flag only if setting to non-blocking worked --- io/io_nonblock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; }