fd-util: Return 1 from fd_nonblock() if we actually change the mode

This commit is contained in:
Daan De Meyer 2024-04-22 10:16:40 +02:00
parent 93cb78aee2
commit e6724664c3

View File

@ -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) {