From 1965d2b22235420a9f39ba598bfa822592056ab9 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 3 Mar 2025 09:34:59 +0100 Subject: [PATCH] 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. --- src/basic/io-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.47.3