time-util: make usleep_safe() support USEC_INFINITY

(cherry picked from commit 78385b8e94)
This commit is contained in:
Yu Watanabe
2025-12-15 18:07:17 +09:00
committed by Luca Boccassi
parent 7898d04c34
commit b1e6cce085

View File

@@ -1804,6 +1804,9 @@ int usleep_safe(usec_t usec) {
if (usec == 0)
return 0;
if (usec == USEC_INFINITY)
return RET_NERRNO(pause());
struct timespec t;
timespec_store(&t, usec);