]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
time-util: make usleep_safe() support USEC_INFINITY
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 15 Dec 2025 09:07:17 +0000 (18:07 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 15 Dec 2025 09:09:21 +0000 (18:09 +0900)
src/basic/time-util.c

index 999150528293673b650db2ffee103476f8221d4c..5dd00af952d2939819c48ba9c44c9bfe2ad29965 100644 (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);