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.
This commit is contained in:
Lennart Poettering
2025-03-03 10:47:09 +01:00
parent 99e6d1b924
commit 1965d2b222
+1 -1
View File
@@ -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);