From: Daan De Meyer Date: Mon, 22 Apr 2024 08:16:40 +0000 (+0200) Subject: fd-util: Return 1 from fd_nonblock() if we actually change the mode X-Git-Tag: v256-rc1~69^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6724664c3d8fa8669746192f647c1845f9857ff;p=thirdparty%2Fsystemd.git fd-util: Return 1 from fd_nonblock() if we actually change the mode --- diff --git a/src/basic/fd-util.c b/src/basic/fd-util.c index 5d005302969..121e6cd2190 100644 --- a/src/basic/fd-util.c +++ b/src/basic/fd-util.c @@ -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) {