diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-10-30 09:57:53 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-10-30 09:57:53 +0100 |
commit | 8a4b13c5cbdbd2fa1cddd14f1e755e2930068377 (patch) | |
tree | 5ab6b974da7213c7ec6ebb55da93ecbd1414f776 /src/run | |
parent | f630daaae90b48606f857c2d35a68f82e4471c8e (diff) | |
download | systemd-8a4b13c5cbdbd2fa1cddd14f1e755e2930068377.tar.gz |
treewide: unify identical definitions of polkit_agent_open_if_enabled() (#7187)
Follows the same pattern as pager_open() now.
Diffstat (limited to 'src/run')
-rw-r--r-- | src/run/run.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/src/run/run.c b/src/run/run.c index f9ca5683a2..111c7f2ef3 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -76,18 +76,6 @@ static const char *arg_on_calendar = NULL; static char **arg_timer_property = NULL; static bool arg_quiet = false; -static void polkit_agent_open_if_enabled(void) { - - /* Open the polkit agent as a child process if necessary */ - if (!arg_ask_password) - return; - - if (arg_transport != BUS_TRANSPORT_LOCAL) - return; - - polkit_agent_open(); -} - static void help(void) { printf("%s [OPTIONS...] {COMMAND} [ARGS...]\n\n" "Run the specified command in a transient scope or service.\n\n" @@ -1027,7 +1015,7 @@ static int start_transient_service( if (r < 0) return bus_log_create_error(r); - polkit_agent_open_if_enabled(); + polkit_agent_open_if_enabled(arg_transport, arg_ask_password); r = sd_bus_call(bus, m, 0, &error, &reply); if (r < 0) @@ -1226,7 +1214,7 @@ static int start_transient_scope( if (r < 0) return bus_log_create_error(r); - polkit_agent_open_if_enabled(); + polkit_agent_open_if_enabled(arg_transport, arg_ask_password); r = sd_bus_call(bus, m, 0, &error, &reply); if (r < 0) { @@ -1436,7 +1424,7 @@ static int start_transient_timer( if (r < 0) return bus_log_create_error(r); - polkit_agent_open_if_enabled(); + polkit_agent_open_if_enabled(arg_transport, arg_ask_password); r = sd_bus_call(bus, m, 0, &error, &reply); if (r < 0) { |