From 346840b1592811d5477c57b85122d39e8c149fa4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 30 May 2022 12:38:58 +0200 Subject: [PATCH] systemctl: make function static --- src/systemctl/systemctl-logind.c | 13 ++++--------- src/systemctl/systemctl-logind.h | 2 -- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/systemctl/systemctl-logind.c b/src/systemctl/systemctl-logind.c index 40521b85954..239bc777ad7 100644 --- a/src/systemctl/systemctl-logind.c +++ b/src/systemctl/systemctl-logind.c @@ -15,17 +15,12 @@ #include "terminal-util.h" #include "user-util.h" -int logind_set_wall_message(void) { +static int logind_set_wall_message(sd_bus *bus) { #if ENABLE_LOGIND _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL; - sd_bus *bus; _cleanup_free_ char *m = NULL; int r; - r = acquire_bus(BUS_FULL, &bus); - if (r < 0) - return r; - m = strv_join(arg_wall, " "); if (!m) return log_oom(); @@ -72,7 +67,7 @@ int logind_reboot(enum action a) { return r; polkit_agent_open_maybe(); - (void) logind_set_wall_message(); + (void) logind_set_wall_message(bus); log_debug("%s org.freedesktop.login1.Manager %s dbus call.", arg_dry_run ? "Would execute" : "Executing", actions[a].method); @@ -310,7 +305,7 @@ int logind_schedule_shutdown(void) { if (arg_dry_run) action = strjoina("dry-", action); - (void) logind_set_wall_message(); + (void) logind_set_wall_message(bus); r = bus_call_method(bus, bus_login_mgr, "ScheduleShutdown", &error, NULL, "st", action, arg_when); if (r < 0) @@ -336,7 +331,7 @@ int logind_cancel_shutdown(void) { if (r < 0) return r; - (void) logind_set_wall_message(); + (void) logind_set_wall_message(bus); r = bus_call_method(bus, bus_login_mgr, "CancelScheduledShutdown", &error, NULL, NULL); if (r < 0) diff --git a/src/systemctl/systemctl-logind.h b/src/systemctl/systemctl-logind.h index 6e73cb76252..925f4559c1b 100644 --- a/src/systemctl/systemctl-logind.h +++ b/src/systemctl/systemctl-logind.h @@ -3,8 +3,6 @@ #include "systemctl.h" -int logind_set_wall_message(void); - int logind_reboot(enum action a); int logind_check_inhibitors(enum action a); -- 2.47.3