|
Zbigniew Jędrzejewski-Szmek |
ef7b48 |
From a8d917c7e49e3111aaf7bd80cd1b8731c4ea81ed 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 02:49:47 +0300
|
|
Zbigniew Jędrzejewski-Szmek |
ef7b48 |
Subject: [PATCH] udev: Fix ping timeout when settle timeout is 0
|
|
Zbigniew Jędrzejewski-Szmek |
ef7b48 |
|
|
Zbigniew Jędrzejewski-Szmek |
ef7b48 |
When running udevadm settle --timeout=0, the ping always times out, and
|
|
Zbigniew Jędrzejewski-Szmek |
ef7b48 |
udevadm will return 0 without checking the queue state.
|
|
Zbigniew Jędrzejewski-Szmek |
ef7b48 |
|
|
Zbigniew Jędrzejewski-Szmek |
ef7b48 |
(David: Use a reasonable timeout to still get the barrier provided by
|
|
Zbigniew Jędrzejewski-Szmek |
ef7b48 |
ctrl-ping)
|
|
Zbigniew Jędrzejewski-Szmek |
ef7b48 |
|
|
Zbigniew Jędrzejewski-Szmek |
ef7b48 |
(cherry picked from commit 7375b3c4871861f100860ea4c2848e66b60e6ca4)
|
|
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 40e3e28b1e..33597bc209 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 |
@@ -114,7 +114,7 @@ static int adm_settle(struct udev *udev, int argc, char *argv[]) {
|
|
Zbigniew Jędrzejewski-Szmek |
ef7b48 |
|
|
Zbigniew Jędrzejewski-Szmek |
ef7b48 |
uctrl = udev_ctrl_new(udev);
|
|
Zbigniew Jędrzejewski-Szmek |
ef7b48 |
if (uctrl != NULL) {
|
|
Zbigniew Jędrzejewski-Szmek |
ef7b48 |
- if (udev_ctrl_send_ping(uctrl, timeout) < 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
ef7b48 |
+ if (udev_ctrl_send_ping(uctrl, MAX(5U, timeout)) < 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
ef7b48 |
log_debug("no connection to daemon");
|
|
Zbigniew Jędrzejewski-Szmek |
ef7b48 |
udev_ctrl_unref(uctrl);
|
|
Zbigniew Jędrzejewski-Szmek |
ef7b48 |
return EXIT_SUCCESS;
|