From: Marcus Folkesson <marcus.folkesson@gmail.com>
To: eudev@lists.gentoo.org
Cc: Marcus Folkesson <marcus.folkesson@gmail.com>
Subject: [eudev] [PATCH] libudev-monitor.c: fail to monitor udev if udev is not started
Date: Tue, 28 Nov 2017 11:48:51 +0100 [thread overview]
Message-ID: <20171128104851.8527-1-marcus.folkesson@gmail.com> (raw)
We makes two controls if we consider udev is started;
access(UDEV_ROOT_RUN "/udev/control", F_OK) < 0
and
!udev_has_devtmpfs(udev))
If one(not both) of these statements fails, we consider that udev is not
running.
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
---
src/libudev/libudev-monitor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libudev/libudev-monitor.c b/src/libudev/libudev-monitor.c
index fe494a4a7..614149c62 100644
--- a/src/libudev/libudev-monitor.c
+++ b/src/libudev/libudev-monitor.c
@@ -186,7 +186,7 @@ struct udev_monitor *udev_monitor_new_from_netlink_fd(struct udev *udev, const c
* We do not set a netlink multicast group here, so the socket
* will not receive any messages.
*/
- if (access(UDEV_ROOT_RUN "/udev/control", F_OK) < 0 && !udev_has_devtmpfs(udev)) {
+ if (access(UDEV_ROOT_RUN "/udev/control", F_OK) < 0 || !udev_has_devtmpfs(udev)) {
log_debug("the udev service seems not to be active, disable the monitor");
group = UDEV_MONITOR_NONE;
} else
--
2.13.1
reply other threads:[~2017-11-28 10:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171128104851.8527-1-marcus.folkesson@gmail.com \
--to=marcus.folkesson@gmail.com \
--cc=eudev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox