mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-11 05:17:44 +03:00
systemctl: make function static
This commit is contained in:
parent
b280061314
commit
346840b159
@ -15,17 +15,12 @@
|
|||||||
#include "terminal-util.h"
|
#include "terminal-util.h"
|
||||||
#include "user-util.h"
|
#include "user-util.h"
|
||||||
|
|
||||||
int logind_set_wall_message(void) {
|
static int logind_set_wall_message(sd_bus *bus) {
|
||||||
#if ENABLE_LOGIND
|
#if ENABLE_LOGIND
|
||||||
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
|
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
|
||||||
sd_bus *bus;
|
|
||||||
_cleanup_free_ char *m = NULL;
|
_cleanup_free_ char *m = NULL;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
r = acquire_bus(BUS_FULL, &bus);
|
|
||||||
if (r < 0)
|
|
||||||
return r;
|
|
||||||
|
|
||||||
m = strv_join(arg_wall, " ");
|
m = strv_join(arg_wall, " ");
|
||||||
if (!m)
|
if (!m)
|
||||||
return log_oom();
|
return log_oom();
|
||||||
@ -72,7 +67,7 @@ int logind_reboot(enum action a) {
|
|||||||
return r;
|
return r;
|
||||||
|
|
||||||
polkit_agent_open_maybe();
|
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);
|
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)
|
if (arg_dry_run)
|
||||||
action = strjoina("dry-", action);
|
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);
|
r = bus_call_method(bus, bus_login_mgr, "ScheduleShutdown", &error, NULL, "st", action, arg_when);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
@ -336,7 +331,7 @@ int logind_cancel_shutdown(void) {
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
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);
|
r = bus_call_method(bus, bus_login_mgr, "CancelScheduledShutdown", &error, NULL, NULL);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
#include "systemctl.h"
|
#include "systemctl.h"
|
||||||
|
|
||||||
int logind_set_wall_message(void);
|
|
||||||
|
|
||||||
int logind_reboot(enum action a);
|
int logind_reboot(enum action a);
|
||||||
int logind_check_inhibitors(enum action a);
|
int logind_check_inhibitors(enum action a);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user