]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: do not remove /run/udev/queue file when we are synthesizing events
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 24 Apr 2025 03:53:29 +0000 (12:53 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 27 Apr 2025 00:47:07 +0000 (09:47 +0900)
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

index 0c59c172e0c9ebfab9c80c57562594f3b31c3b95..7748a073b730dd661d874be799e7481f0ce9e802 100644 (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)