]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: Fix ping timeout when settle timeout is 0
authorNir Soffer <nirsof@gmail.com>
Sat, 18 Apr 2015 23:49:47 +0000 (02:49 +0300)
committerDavid Herrmann <dh.herrmann@gmail.com>
Wed, 22 Apr 2015 17:16:58 +0000 (19:16 +0200)
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)

src/udev/udevadm-settle.c

index 437c79408a675af5718e7d540e3e29f4d401e052..79f45610db029107bb812f46c337da2be2db9330 100644 (file)
@@ -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;