diff options
Diffstat (limited to 'src/udev/udevadm-settle.c')
-rw-r--r-- | src/udev/udevadm-settle.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/udev/udevadm-settle.c b/src/udev/udevadm-settle.c index 4ae237d430..8d9c4509ff 100644 --- a/src/udev/udevadm-settle.c +++ b/src/udev/udevadm-settle.c @@ -18,6 +18,7 @@ #include "udevadm.h" #include "udev-ctrl.h" #include "util.h" +#include "virt.h" static usec_t arg_timeout = 120 * USEC_PER_SEC; static const char *arg_exists = NULL; @@ -88,6 +89,11 @@ int settle_main(int argc, char *argv[], void *userdata) { if (r <= 0) return r; + if (running_in_chroot() > 0) { + log_info("Running in chroot, ignoring request."); + return 0; + } + deadline = now(CLOCK_MONOTONIC) + arg_timeout; /* guarantee that the udev daemon isn't pre-processing */ @@ -96,9 +102,9 @@ int settle_main(int argc, char *argv[], void *userdata) { uctrl = udev_ctrl_new(); if (uctrl) { - r = udev_ctrl_send_ping(uctrl, MAX(5U, arg_timeout / USEC_PER_SEC)); + r = udev_ctrl_send_ping(uctrl, MAX(5 * USEC_PER_SEC, arg_timeout)); if (r < 0) { - log_debug_errno(r, "Failed to connect to udev daemon."); + log_debug_errno(r, "Failed to connect to udev daemon: %m"); return 0; } } |