From: Lennart Poettering Date: Mon, 3 Mar 2025 08:34:59 +0000 (+0100) Subject: io-util: fix ppoll_usec() bypass X-Git-Tag: v258-rc1~1202^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F36568%2Fhead;p=thirdparty%2Fsystemd.git io-util: fix ppoll_usec() bypass If a non-zero timeout is specified we should not bypass ppoll() even if no fds are specified, since it will still act as a time based sleep in that case. --- diff --git a/src/basic/io-util.c b/src/basic/io-util.c index d8b56d05955..f12f6b192c9 100644 --- a/src/basic/io-util.c +++ b/src/basic/io-util.c @@ -208,7 +208,7 @@ int ppoll_usec_full(struct pollfd *fds, size_t nfds, usec_t timeout, const sigse * to handle signals, such as signalfd() or signal handlers. ⚠️ ⚠️ ⚠️ */ - if (nfds == 0) + if (nfds == 0 && timeout == 0) return 0; r = ppoll(fds, nfds, timeout == USEC_INFINITY ? NULL : TIMESPEC_STORE(timeout), ss);