From 59ec09a83e426a27252c0fd855b5338db53c8fba Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Tue, 15 Nov 2016 15:01:40 -0500 Subject: pid1: simplify the logic in two statements related to killing processes Generally non-inverted conditions are nicer, and ternary operators with complex conditions are a bit hard to read. No functional change. --- src/core/scope.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/core/scope.c') diff --git a/src/core/scope.c b/src/core/scope.c index d6e1f8e392..9540fb67d9 100644 --- a/src/core/scope.c +++ b/src/core/scope.c @@ -273,7 +273,9 @@ static void scope_enter_signal(Scope *s, ScopeState state, ScopeResult f) { if (state == SCOPE_STOP_SIGTERM) skip_signal = bus_scope_send_request_stop(s) > 0; - if (!skip_signal) { + if (skip_signal) + r = 1; /* wait */ + else { r = unit_kill_context( UNIT(s), &s->kill_context, @@ -283,8 +285,7 @@ static void scope_enter_signal(Scope *s, ScopeState state, ScopeResult f) { -1, -1, false); if (r < 0) goto fail; - } else - r = 1; + } if (r > 0) { r = scope_arm_timer(s, usec_add(now(CLOCK_MONOTONIC), s->timeout_stop_usec)); -- cgit v1.2.3-54-g00ecf