summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-12-08 18:23:39 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-12-13 14:52:19 -0500
commit76b6f3f68f133ae017e577219244b02e1c361446 (patch)
tree1e887e43f23ca08a5d842d085b0ca5aefea33531
parentc9811ac800df461b010909f343a2e0251b6b57d4 (diff)
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.
-rw-r--r--src/core/manager.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index 34dd715e93..9f65e0ff32 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)