From: Yu Watanabe Date: Tue, 19 Dec 2023 03:28:53 +0000 (+0900) Subject: udev: handle event_timeout=infinity correctly X-Git-Tag: v256-rc1~1399^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aff70e13885696822c2caac44fb1612c3141431c;p=thirdparty%2Fsystemd.git udev: handle event_timeout=infinity correctly This is a paranoia, as even USEC_INFINITY / 3 is finite, it is still so large in general. --- diff --git a/src/udev/udev-spawn.h b/src/udev/udev-spawn.h index 5efea2e8862..ba6f1ae872e 100644 --- a/src/udev/udev-spawn.h +++ b/src/udev/udev-spawn.h @@ -24,5 +24,8 @@ int udev_event_spawn( void udev_event_execute_run(UdevEvent *event, usec_t timeout_usec, int timeout_signal); static inline usec_t udev_warn_timeout(usec_t timeout_usec) { + if (timeout_usec == USEC_INFINITY) + return USEC_INFINITY; + return DIV_ROUND_UP(timeout_usec, 3); }