summaryrefslogtreecommitdiff
path: root/src/udev
diff options
context:
space:
mode:
authorNir Soffer <nirsof@gmail.com>2015-04-19 02:49:47 +0300
committerDavid Herrmann <dh.herrmann@gmail.com>2015-04-22 19:16:58 +0200
commit7375b3c4871861f100860ea4c2848e66b60e6ca4 (patch)
treeeb224cbf80bff9407042ca0809757f9caa0e5c25 /src/udev
parent6d785b6d07767834a7a00209b5de376ea42075fe (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)
Diffstat (limited to 'src/udev')
-rw-r--r--src/udev/udevadm-settle.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/udev/udevadm-settle.c b/src/udev/udevadm-settle.c
index 437c79408a..79f45610db 100644
--- a/src/udev/udevadm-settle.c
+++ b/src/udev/udevadm-settle.c
@@ -107,7 +107,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;