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