summaryrefslogtreecommitdiff
path: root/src/libudev/libudev-monitor.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libudev/libudev-monitor.c')
-rw-r--r--src/libudev/libudev-monitor.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/libudev/libudev-monitor.c b/src/libudev/libudev-monitor.c
index ba1b04d479..3f7436b094 100644
--- a/src/libudev/libudev-monitor.c
+++ b/src/libudev/libudev-monitor.c
@@ -146,21 +146,6 @@ static bool udev_has_devtmpfs(struct udev *udev) {
return false;
}
-/* we consider udev running when we have running udev service */
-static bool udev_has_service(struct udev *udev) {
- struct udev_queue *queue;
- bool active;
-
- queue = udev_queue_new(udev);
- if (!queue)
- return false;
-
- active = udev_queue_get_udev_is_active(queue);
- udev_queue_unref(queue);
-
- return active;
-}
-
struct udev_monitor *udev_monitor_new_from_netlink_fd(struct udev *udev, const char *name, int fd)
{
struct udev_monitor *udev_monitor;
@@ -184,7 +169,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 (!udev_has_service(udev) && !udev_has_devtmpfs(udev)) {
+ if (access("/run/udev/control", F_OK) < 0 && !udev_has_devtmpfs(udev)) {
udev_dbg(udev, "the udev service seems not to be active, disable the monitor\n");
group = UDEV_MONITOR_NONE;
} else