diff options
Diffstat (limited to 'src/libstddjb/uncoe.c')
-rw-r--r-- | src/libstddjb/uncoe.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libstddjb/uncoe.c b/src/libstddjb/uncoe.c index b6bf430..be7b90c 100644 --- a/src/libstddjb/uncoe.c +++ b/src/libstddjb/uncoe.c @@ -6,6 +6,5 @@ int uncoe (int fd) { int flags = fcntl(fd, F_GETFD, 0) ; - if (flags < 0) return -1 ; - return fcntl(fd, F_SETFD, flags & ~FD_CLOEXEC) ; + return flags < 0 ? flags : flags & FD_CLOEXEC ? fcntl(fd, F_SETFD, flags & ~FD_CLOEXEC) : 0 ; } |