From: Lennart Poettering Date: Wed, 20 Sep 2023 15:38:46 +0000 (+0200) Subject: scope: also modernize state machine logging X-Git-Tag: v255-rc1~392^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5acfe18fbeb39fb8f78b3047dd2ad60983f571a;p=thirdparty%2Fsystemd.git scope: also modernize state machine logging --- diff --git a/src/core/scope.c b/src/core/scope.c index 1664d49c94b..78aa638ed2c 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); }