mirror of
https://github.com/systemd/systemd.git
synced 2024-11-24 10:43:35 +08:00
fd-util: Return 1 from fd_nonblock() if we actually change the mode
This commit is contained in:
parent
93cb78aee2
commit
e6724664c3
@ -167,7 +167,10 @@ int fd_nonblock(int fd, bool nonblock) {
|
||||
if (nflags == flags)
|
||||
return 0;
|
||||
|
||||
return RET_NERRNO(fcntl(fd, F_SETFL, nflags));
|
||||
if (fcntl(fd, F_SETFL, nflags) < 0)
|
||||
return -errno;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int stdio_disable_nonblock(void) {
|
||||
|
Loading…
Reference in New Issue
Block a user