summaryrefslogtreecommitdiff
path: root/src/libstddjb/ndelay_off.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstddjb/ndelay_off.c')
-rw-r--r--src/libstddjb/ndelay_off.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstddjb/ndelay_off.c b/src/libstddjb/ndelay_off.c
index 209fd2b..5ea68c6 100644
--- a/src/libstddjb/ndelay_off.c
+++ b/src/libstddjb/ndelay_off.c
@@ -6,5 +6,5 @@
int ndelay_off (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 ? fcntl(fd, F_SETFL, got & ~O_NONBLOCK) : 0 ;
}