util: fix fd_cloexec(), fd_nonblock()
This commit is contained in:
parent
6cfe2fde1c
commit
34b42c9694
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue