Revert "udevd: fix crash when workers time out after exit is signal caught"
authorMartin Wilck <mwilck@suse.com>
Tue, 26 Nov 2019 17:36:46 +0000 (18:36 +0100)
committerMartin Wilck <mwilck@suse.com>
Tue, 26 Nov 2019 19:38:28 +0000 (20:38 +0100)
This reverts commit 5db454b8031c58a743cc4ee3d5d1dd01dcff17e8.
See https://github.com/systemd/systemd/issues/14128

src/udev/udevd.c

index 2bb3227..144a20e 100644 (file)
@@ -293,8 +293,6 @@ static void manager_free(Manager *manager) {
         if (!manager)
                 return;
 
-        manager->monitor = sd_device_monitor_unref(manager->monitor);
-
         udev_builtin_exit();
 
         if (manager->pid == getpid_cached())
@@ -791,6 +789,8 @@ static void manager_exit(Manager *manager) {
         manager->inotify_event = sd_event_source_unref(manager->inotify_event);
         manager->fd_inotify = safe_close(manager->fd_inotify);
 
+        manager->monitor = sd_device_monitor_unref(manager->monitor);
+
         /* discard queued events and kill workers */
         event_queue_cleanup(manager, EVENT_QUEUED);
         manager_kill_workers(manager);