]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: drop event_is_blocked()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 6 May 2025 18:13:43 +0000 (03:13 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 9 May 2025 17:41:29 +0000 (02:41 +0900)
As now it is a trivial wrapper of event_build_dependencies().

src/udev/udev-manager.c

index 709ec4187620028c650a9ec077cf2f078e2012fd..38ab906af200b21f0850ca6bad2592d4b99907bc 100644 (file)
@@ -677,18 +677,6 @@ static int event_build_dependencies(Event *event) {
         return 0;
 }
 
-static int event_is_blocked(Event *event) {
-        int r;
-
-        assert(event);
-
-        r = event_build_dependencies(event);
-        if (r < 0)
-                return r;
-
-        return !set_isempty(event->blocker_events);
-}
-
 static bool manager_can_process_event(Manager *manager) {
         static bool children_max_reached_logged = false;
 
@@ -743,16 +731,15 @@ static int event_queue_start(Manager *manager) {
                 if (event->state != EVENT_QUEUED)
                         continue;
 
-                /* do not start event if parent or child event is still running or queued */
-                r = event_is_blocked(event);
-                if (r > 0)
-                        continue;
+                r = event_build_dependencies(event);
                 if (r < 0)
                         log_device_warning_errno(event->dev, r,
-                                                 "Failed to check dependencies for event (SEQNUM=%"PRIu64", ACTION=%s), "
-                                                 "assuming there is no blocking event, ignoring: %m",
-                                                 event->seqnum,
-                                                 strna(device_action_to_string(event->action)));
+                                                 "Failed to check dependencies for event (SEQNUM=%"PRIu64", ACTION=%s), ignoring: %m",
+                                                 event->seqnum, strna(device_action_to_string(event->action)));
+
+                /* do not start event if parent or child event is still running or queued */
+                if (!set_isempty(event->blocker_events))
+                        continue;
 
                 r = event_run(event);
                 if (r < 0)