From: Zbigniew Jędrzejewski-Szmek Date: Tue, 8 Dec 2015 23:23:39 +0000 (-0500) Subject: manager: move status output change debug messages to set function X-Git-Tag: v229~204^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=76b6f3f68f133ae017e577219244b02e1c361446;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/core/manager.c b/src/core/manager.c index 34dd715e93d..9f65e0ff32a 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -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)