1 |
We makes two controls if we consider udev is started; |
2 |
access(UDEV_ROOT_RUN "/udev/control", F_OK) < 0 |
3 |
and |
4 |
!udev_has_devtmpfs(udev)) |
5 |
|
6 |
If one(not both) of these statements fails, we consider that udev is not |
7 |
running. |
8 |
|
9 |
Signed-off-by: Marcus Folkesson <marcus.folkesson@×××××.com> |
10 |
--- |
11 |
src/libudev/libudev-monitor.c | 2 +- |
12 |
1 file changed, 1 insertion(+), 1 deletion(-) |
13 |
|
14 |
diff --git a/src/libudev/libudev-monitor.c b/src/libudev/libudev-monitor.c |
15 |
index fe494a4a7..614149c62 100644 |
16 |
--- a/src/libudev/libudev-monitor.c |
17 |
+++ b/src/libudev/libudev-monitor.c |
18 |
@@ -186,7 +186,7 @@ struct udev_monitor *udev_monitor_new_from_netlink_fd(struct udev *udev, const c |
19 |
* We do not set a netlink multicast group here, so the socket |
20 |
* will not receive any messages. |
21 |
*/ |
22 |
- if (access(UDEV_ROOT_RUN "/udev/control", F_OK) < 0 && !udev_has_devtmpfs(udev)) { |
23 |
+ if (access(UDEV_ROOT_RUN "/udev/control", F_OK) < 0 || !udev_has_devtmpfs(udev)) { |
24 |
log_debug("the udev service seems not to be active, disable the monitor"); |
25 |
group = UDEV_MONITOR_NONE; |
26 |
} else |
27 |
-- |
28 |
2.13.1 |