]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
scope: also modernize state machine logging
authorLennart Poettering <lennart@poettering.net>
Wed, 20 Sep 2023 15:38:46 +0000 (17:38 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 27 Sep 2023 15:35:50 +0000 (17:35 +0200)
src/core/scope.c

index 1664d49c94b54a90554b007bdc604e1c1e8b0af2..78aa638ed2c3c205e58ca82ad71be2cd098cfb49 100644 (file)
@@ -348,14 +348,18 @@ static void scope_enter_signal(Scope *s, ScopeState state, ScopeResult f) {
                                 /* main_pid= */ NULL,
                                 /* control_pid= */ NULL,
                                 /* main_pid_alien= */ false);
-                if (r < 0)
+                if (r < 0) {
+                        log_unit_warning_errno(UNIT(s), r, "Failed to kill processes: %m");
                         goto fail;
+                }
         }
 
         if (r > 0) {
                 r = scope_arm_timer(s, usec_add(now(CLOCK_MONOTONIC), s->timeout_stop_usec));
-                if (r < 0)
+                if (r < 0) {
+                        log_unit_warning_errno(UNIT(s), r, "Failed to install timer: %m");
                         goto fail;
+                }
 
                 scope_set_state(s, state);
         } else if (state == SCOPE_STOP_SIGTERM)
@@ -366,8 +370,6 @@ static void scope_enter_signal(Scope *s, ScopeState state, ScopeResult f) {
         return;
 
 fail:
-        log_unit_warning_errno(UNIT(s), r, "Failed to kill processes: %m");
-
         scope_enter_dead(s, SCOPE_FAILURE_RESOURCES);
 }