From c5acfe18fbeb39fb8f78b3047dd2ad60983f571a Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 20 Sep 2023 17:38:46 +0200 Subject: [PATCH] scope: also modernize state machine logging --- src/core/scope.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/scope.c b/src/core/scope.c index 1664d49c94..78aa638ed2 100644 --- a/src/core/scope.c +++ b/src/core/scope.c @@ -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); } -- 2.25.1