Blame SOURCES/0139-udev-settle-should-return-immediately-when-timeout-i.patch

17b0f1
From 98b78068d13095fdd40883b2b6c815a9ebb59435 Mon Sep 17 00:00:00 2001
17b0f1
From: Nir Soffer <nirsof@gmail.com>
17b0f1
Date: Sun, 19 Apr 2015 03:41:26 +0300
17b0f1
Subject: [PATCH] udev: settle should return immediately when timeout is 0
17b0f1
17b0f1
udevadm manual says:
17b0f1
17b0f1
    A value of 0 will check if the queue is empty and always return
17b0f1
    immediately.
17b0f1
17b0f1
However, currently we ignore the deadline if the value is 0, and wait
17b0f1
without any limit.
17b0f1
17b0f1
Zero timeout behaved according to the documentation until commit
17b0f1
ead7c62ab7 (udevadm: settle - kill alarm()). Looking at this patch, it
17b0f1
seems that the behavior change was unintended.
17b0f1
17b0f1
This patch restores the documented behavior.
17b0f1
17b0f1
Cherry-picked from: bf23b9f86f6807c3029a6a46e1999ae0c87ca22a
17b0f1
Resolves: #1210981
17b0f1
---
17b0f1
 src/udev/udevadm-settle.c | 2 +-
17b0f1
 1 file changed, 1 insertion(+), 1 deletion(-)
17b0f1
17b0f1
diff --git a/src/udev/udevadm-settle.c b/src/udev/udevadm-settle.c
17b0f1
index e60c4623bd..40e3e28b1e 100644
17b0f1
--- a/src/udev/udevadm-settle.c
17b0f1
+++ b/src/udev/udevadm-settle.c
17b0f1
@@ -149,7 +149,7 @@ static int adm_settle(struct udev *udev, int argc, char *argv[]) {
17b0f1
                         break;
17b0f1
                 }
17b0f1
 
17b0f1
-                if (timeout > 0 && now(CLOCK_MONOTONIC) >= deadline)
17b0f1
+                if (now(CLOCK_MONOTONIC) >= deadline)
17b0f1
                         break;
17b0f1
 
17b0f1
                 /* wake up when queue is empty */