summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2014-05-20 12:25:16 +0200
committerHarald Hoyer <harald@redhat.com>2014-05-20 12:25:16 +0200
commit83be2c398589a3d64db5999cfd5527c5219bff46 (patch)
treeb38a575c21f24d3c01614b8e4a0ca2259b4206af
parent8477107dec4c89e2b85dfbf92051d96dd4f51480 (diff)
udevadm-settle: fixed return code for empty queue
If the udev queue is empty and "/run/udev/queue" does not exist, "udevadm settle" would return with EXIT_FAILURE, because the inotify on "/run/udev/queue" would fail with ENOENT. This patch lets "udevadm settle" exit with EXIT_SUCCESS in this case.
-rw-r--r--src/udev/udevadm-settle.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/udev/udevadm-settle.c b/src/udev/udevadm-settle.c
index 65fc35f9a0..66fd843012 100644
--- a/src/udev/udevadm-settle.c
+++ b/src/udev/udevadm-settle.c
@@ -116,7 +116,11 @@ static int adm_settle(struct udev *udev, int argc, char *argv[])
}
if (inotify_add_watch(pfd[0].fd, "/run/udev/queue" , IN_DELETE) < 0) {
- log_debug("watching /run/udev failed");
+ /* If it does not exist, we don't have to wait */
+ if (errno == ENOENT)
+ rc = EXIT_SUCCESS;
+ else
+ log_debug("watching /run/udev/queue failed");
goto out;
}