diff options
Diffstat (limited to 'src/libstddjb/ndelay_on.c')
-rw-r--r-- | src/libstddjb/ndelay_on.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstddjb/ndelay_on.c b/src/libstddjb/ndelay_on.c index 63ffa58..1bf9527 100644 --- a/src/libstddjb/ndelay_on.c +++ b/src/libstddjb/ndelay_on.c @@ -6,5 +6,5 @@ int ndelay_on (int fd) { int got = fcntl(fd, F_GETFL) ; - return (got == -1) ? -1 : fcntl(fd, F_SETFL, got | O_NONBLOCK) ; + return got < 0 ? got : got & O_NONBLOCK ? 0 : fcntl(fd, F_SETFL, got | O_NONBLOCK) ; } |