summaryrefslogtreecommitdiff
path: root/src/libudev/libudev-monitor.c
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2014-04-24 15:40:08 -0400
committerAnthony G. Basile <blueness@gentoo.org>2014-04-24 15:40:08 -0400
commit2500dbc810d8898c1359c6579715586fffa08a27 (patch)
treee24445a5829c7c4f4da6bf7652ece1acaf008b6c /src/libudev/libudev-monitor.c
parentdbc5e32faeca842ec5a4a07702080b3195e21d66 (diff)
udev: remove seqnum API and all assumptions about seqnums
The way the kernel namespaces have been implemented breaks assumptions udev made regarding uevent sequence numbers. Creating devices in a namespace "steals" uevents and its sequence numbers from the host. It confuses the "udevadmin settle" logic, which might block until util a timeout is reached, even when no uevent is pending. Remove any assumptions about sequence numbers and deprecate libudev's API exposing these numbers; none of that can reliably be used anymore when namespaces are involved. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
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 ff522b8607..43fd8762da 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