core: output unit status output strings to console, only if we actually are changing unit state
Unit _start() and _stop() implementations can fail with -EAGAIN to delay execution temporarily. Thus, we should not output status messages before invoking these calls, but after, and only when we know that the invocation actually made a change.
This commit is contained in:
+2
-2
@@ -295,7 +295,7 @@ static int scope_start(Unit *u) {
|
||||
s->result = SCOPE_SUCCESS;
|
||||
|
||||
scope_set_state(s, SCOPE_RUNNING);
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int scope_stop(Unit *u) {
|
||||
@@ -311,7 +311,7 @@ static int scope_stop(Unit *u) {
|
||||
s->state == SCOPE_ABANDONED);
|
||||
|
||||
scope_enter_signal(s, SCOPE_STOP_SIGTERM, SCOPE_SUCCESS);
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void scope_reset_failed(Unit *u) {
|
||||
|
||||
Reference in New Issue
Block a user