diff options
author | Harald Hoyer <harald@redhat.com> | 2014-05-20 12:25:16 +0200 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2014-05-23 08:54:40 -0400 |
commit | e936eee10fe09d423cdb0754de92ed7fb111f561 (patch) | |
tree | a4d28a37701b9d19300985b9afdcdcaced1aedc2 /src | |
parent | db1e5f3021c49c4a320e70a8f9827855f2da385e (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.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/udev/udevadm-settle.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/udev/udevadm-settle.c b/src/udev/udevadm-settle.c index 73f74e1ac8..b1724f2687 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; } |