From 5de236bd0771088cc5958559267a5b59ec99ed77 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 24 Apr 2025 12:53:29 +0900 Subject: [PATCH] udev: do not remove /run/udev/queue file when we are synthesizing events Note, it should be safe even if we synthesize no event, e.g. when the device has been already removed. In such case, the post event after SIGCHLD will remove the file. --- src/udev/udev-manager.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/udev/udev-manager.c b/src/udev/udev-manager.c index 0c59c172e0..7748a073b7 100644 --- a/src/udev/udev-manager.c +++ b/src/udev/udev-manager.c @@ -1154,6 +1154,9 @@ static int manager_unlink_queue_file(Manager *manager) { if (manager->events) return 0; /* There are queued events. */ + if (!set_isempty(manager->synthesize_change_child_event_sources)) + return 0; /* There are child processes that should trigger synthetic events. */ + /* There are no queued events. Let's remove /run/udev/queue and clean up the idle processes. */ if (unlink("/run/udev/queue") < 0) { if (errno != ENOENT)