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.
This commit is contained in:
Yu Watanabe
2025-04-27 09:47:07 +09:00
parent 17b43e213b
commit 5de236bd07
+3
View File
@@ -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)