[systemd-devel] [PATCH v3 2/2] udev: Skip ping if timeout is 0
Nir Soffer
nirsof at gmail.com
Sat Apr 18 17:41:27 PDT 2015
When running udevadm settle --timeout=0, udev_ctrl_send_ping always
times out, and settle returns 0 without checking the queue.
Now we skip ping in this case, and return the queue state.
---
src/udev/udevadm-settle.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/udev/udevadm-settle.c b/src/udev/udevadm-settle.c
index 437c794..614768f 100644
--- a/src/udev/udevadm-settle.c
+++ b/src/udev/udevadm-settle.c
@@ -102,7 +102,7 @@ static int adm_settle(struct udev *udev, int argc, char *argv[]) {
deadline = now(CLOCK_MONOTONIC) + timeout * USEC_PER_SEC;
/* guarantee that the udev daemon isn't pre-processing */
- if (getuid() == 0) {
+ if (timeout > 0 && getuid() == 0) {
struct udev_ctrl *uctrl;
uctrl = udev_ctrl_new(udev);
--
1.9.3
More information about the systemd-devel
mailing list