manager: move status output change debug messages to set function
This way we can only print the debug message when the status actually changes. We also means we don't print anything when running in --user mode, where status output is always disabled.
This commit is contained in:
parent
c9811ac800
commit
76b6f3f68f
|
@ -1885,12 +1885,10 @@ static int manager_dispatch_signal_fd(sd_event_source *source, int fd, uint32_t
|
|||
switch (sfsi.ssi_signo - SIGRTMIN) {
|
||||
|
||||
case 20:
|
||||
log_debug("Enabling showing of status.");
|
||||
manager_set_show_status(m, SHOW_STATUS_YES);
|
||||
break;
|
||||
|
||||
case 21:
|
||||
log_debug("Disabling showing of status.");
|
||||
manager_set_show_status(m, SHOW_STATUS_NO);
|
||||
break;
|
||||
|
||||
|
@ -2961,6 +2959,9 @@ void manager_set_show_status(Manager *m, ShowStatus mode) {
|
|||
if (m->running_as != MANAGER_SYSTEM)
|
||||
return;
|
||||
|
||||
if (m->show_status != mode)
|
||||
log_debug("%s showing of status.",
|
||||
mode == SHOW_STATUS_NO ? "Disabling" : "Enabling");
|
||||
m->show_status = mode;
|
||||
|
||||
if (mode > 0)
|
||||
|
|
Loading…
Reference in a new issue