* [eudev] [PATCH] libudev-monitor.c: fail to monitor udev if udev is not started
@ 2017-11-28 10:48 Marcus Folkesson
0 siblings, 0 replies; only message in thread
From: Marcus Folkesson @ 2017-11-28 10:48 UTC (permalink / raw
To: eudev; +Cc: Marcus Folkesson
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-11-28 10:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-28 10:48 [eudev] [PATCH] libudev-monitor.c: fail to monitor udev if udev is not started Marcus Folkesson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox