]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: settle should return immediately when timeout is 0
authorNir Soffer <nirsof@gmail.com>
Sun, 19 Apr 2015 00:41:26 +0000 (03:41 +0300)
committerDavid Herrmann <dh.herrmann@gmail.com>
Mon, 20 Apr 2015 16:48:55 +0000 (18:48 +0200)
udevadm manual says:

    A value of 0 will check if the queue is empty and always return
    immediately.

However, currently we ignore the deadline if the value is 0, and wait
without any limit.

Zero timeout behaved according to the documentation until commit
ead7c62ab7 (udevadm: settle - kill alarm()). Looking at this patch, it
seems that the behavior change was unintended.

This patch restores the documented behavior.

src/udev/udevadm-settle.c

index 2c84ada0b10c32257ef9fb6c6a5f4e82dcd44c59..437c79408a675af5718e7d540e3e29f4d401e052 100644 (file)
@@ -142,7 +142,7 @@ static int adm_settle(struct udev *udev, int argc, char *argv[]) {
                         break;
                 }
 
-                if (timeout > 0 && now(CLOCK_MONOTONIC) >= deadline)
+                if (now(CLOCK_MONOTONIC) >= deadline)
                         break;
 
                 /* wake up when queue is empty */