diff options
author | Nir Soffer <nirsof@gmail.com> | 2015-04-19 02:49:47 +0300 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2015-05-03 14:43:16 -0400 |
commit | 1f84e42e19ac9d0b4e84983317207d0b8718d1d1 (patch) | |
tree | b7b8ec215a8b62612d8df245332f2609a3443ac3 /src/udev | |
parent | 6534505be742b9de1711403ef7ccda0f389dafea (diff) |
udev: Fix ping timeout when settle timeout is 0
When running udevadm settle --timeout=0, the ping always times out, and
udevadm will return 0 without checking the queue state.
(David: Use a reasonable timeout to still get the barrier provided by
ctrl-ping)
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/udev')
-rw-r--r-- | src/udev/udevadm-settle.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/udev/udevadm-settle.c b/src/udev/udevadm-settle.c index 40e3e28b1e..33597bc209 100644 --- a/src/udev/udevadm-settle.c +++ b/src/udev/udevadm-settle.c @@ -114,7 +114,7 @@ static int adm_settle(struct udev *udev, int argc, char *argv[]) { uctrl = udev_ctrl_new(udev); if (uctrl != NULL) { - if (udev_ctrl_send_ping(uctrl, timeout) < 0) { + if (udev_ctrl_send_ping(uctrl, MAX(5U, timeout)) < 0) { log_debug("no connection to daemon"); udev_ctrl_unref(uctrl); return EXIT_SUCCESS; |