udev: handle event_timeout=infinity correctly

This is a paranoia, as even USEC_INFINITY / 3 is finite, it is still so large
in general.
This commit is contained in:
Yu Watanabe
2023-12-23 04:30:32 +09:00
parent 7ca31a91de
commit aff70e1388
+3
View File
@@ -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);
}