Skip to content

Commit 5de236b

Browse files
committed
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.
1 parent 17b43e2 commit 5de236b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/udev/udev-manager.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,6 +1154,9 @@ static int manager_unlink_queue_file(Manager *manager) {
11541154
if (manager->events)
11551155
return 0; /* There are queued events. */
11561156

1157+
if (!set_isempty(manager->synthesize_change_child_event_sources))
1158+
return 0; /* There are child processes that should trigger synthetic events. */
1159+
11571160
/* There are no queued events. Let's remove /run/udev/queue and clean up the idle processes. */
11581161
if (unlink("/run/udev/queue") < 0) {
11591162
if (errno != ENOENT)

0 commit comments

Comments
 (0)