util: fix fd_cloexec(), fd_nonblock()

This commit is contained in:
Lennart Poettering 2014-06-05 19:38:00 +02:00
parent 6cfe2fde1c
commit 34b42c9694

View file

@ -1393,7 +1393,7 @@ int fd_nonblock(int fd, bool nonblock) {
if (nflags == flags)
return 0;
if (fcntl(fd, F_SETFL, flags) < 0)
if (fcntl(fd, F_SETFL, nflags) < 0)
return -errno;
return 0;
@ -1416,7 +1416,7 @@ int fd_cloexec(int fd, bool cloexec) {
if (nflags == flags)
return 0;
if (fcntl(fd, F_SETFD, flags) < 0)
if (fcntl(fd, F_SETFD, nflags) < 0)
return -errno;
return 0;