set flag only if setting to non-blocking worked

master
leitner 21 years ago
parent aeb609627b
commit 27ffe564a7

@ -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 (fcntl(d,F_SETFL,fcntl(d,F_GETFL,0) | O_NDELAY)==0)
if (e) e->nonblock=1;
}

Loading…
Cancel
Save