mirror of
https://github.com/systemd/systemd.git
synced 2024-11-27 20:23:36 +08:00
tree-wide: voidify polkit_agent_open_if_enabled()
This commit is contained in:
parent
69e7d2efdf
commit
f3cf6167ef
@ -524,7 +524,7 @@ static int set_simple_string_internal(sd_bus *bus, sd_bus_error *error, const ch
|
||||
_cleanup_(sd_bus_error_free) sd_bus_error e = SD_BUS_ERROR_NULL;
|
||||
int r;
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
if (!error)
|
||||
error = &e;
|
||||
|
@ -179,7 +179,7 @@ static int transfer_image_common(sd_bus *bus, sd_bus_message *m) {
|
||||
assert(bus);
|
||||
assert(m);
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
r = sd_event_default(&event);
|
||||
if (r < 0)
|
||||
@ -867,7 +867,7 @@ static int cancel_transfer(int argc, char *argv[], void *userdata) {
|
||||
sd_bus *bus = ASSERT_PTR(userdata);
|
||||
int r;
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
for (int i = 1; i < argc; i++) {
|
||||
uint32_t id;
|
||||
|
@ -187,7 +187,7 @@ static int set_locale(int argc, char **argv, void *userdata) {
|
||||
sd_bus *bus = ASSERT_PTR(userdata);
|
||||
int r;
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
r = bus_message_new_method_call(bus, &m, bus_locale, "SetLocale");
|
||||
if (r < 0)
|
||||
@ -229,7 +229,7 @@ static int set_vconsole_keymap(int argc, char **argv, void *userdata) {
|
||||
sd_bus *bus = ASSERT_PTR(userdata);
|
||||
int r;
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
map = argv[1];
|
||||
toggle_map = argc > 2 ? argv[2] : "";
|
||||
@ -268,7 +268,7 @@ static int set_x11_keymap(int argc, char **argv, void *userdata) {
|
||||
sd_bus *bus = userdata;
|
||||
int r;
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
layout = argv[1];
|
||||
model = argc > 2 ? argv[2] : "";
|
||||
|
@ -1197,7 +1197,7 @@ static int activate(int argc, char *argv[], void *userdata) {
|
||||
|
||||
assert(argv);
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
if (argc < 2) {
|
||||
r = sd_bus_call_method(
|
||||
@ -1240,7 +1240,7 @@ static int kill_session(int argc, char *argv[], void *userdata) {
|
||||
|
||||
assert(argv);
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
if (!arg_kill_whom)
|
||||
arg_kill_whom = "all";
|
||||
@ -1268,7 +1268,7 @@ static int enable_linger(int argc, char *argv[], void *userdata) {
|
||||
|
||||
assert(argv);
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
b = streq(argv[0], "enable-linger");
|
||||
|
||||
@ -1314,7 +1314,7 @@ static int terminate_user(int argc, char *argv[], void *userdata) {
|
||||
|
||||
assert(argv);
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
for (int i = 1; i < argc; i++) {
|
||||
uid_t uid;
|
||||
@ -1344,7 +1344,7 @@ static int kill_user(int argc, char *argv[], void *userdata) {
|
||||
|
||||
assert(argv);
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
if (!arg_kill_whom)
|
||||
arg_kill_whom = "all";
|
||||
@ -1382,7 +1382,7 @@ static int attach(int argc, char *argv[], void *userdata) {
|
||||
|
||||
assert(argv);
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
for (int i = 2; i < argc; i++) {
|
||||
|
||||
@ -1406,7 +1406,7 @@ static int flush_devices(int argc, char *argv[], void *userdata) {
|
||||
|
||||
assert(argv);
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
r = bus_call_method(bus, bus_login_mgr, "FlushDevices", &error, NULL, "b", true);
|
||||
if (r < 0)
|
||||
@ -1422,7 +1422,7 @@ static int lock_sessions(int argc, char *argv[], void *userdata) {
|
||||
|
||||
assert(argv);
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
r = bus_call_method(
|
||||
bus,
|
||||
@ -1443,7 +1443,7 @@ static int terminate_seat(int argc, char *argv[], void *userdata) {
|
||||
|
||||
assert(argv);
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
for (int i = 1; i < argc; i++) {
|
||||
|
||||
|
@ -1044,7 +1044,7 @@ static int kill_machine(int argc, char *argv[], void *userdata) {
|
||||
sd_bus *bus = ASSERT_PTR(userdata);
|
||||
int r;
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
if (!arg_kill_whom)
|
||||
arg_kill_whom = "all";
|
||||
@ -1089,7 +1089,7 @@ static int terminate_machine(int argc, char *argv[], void *userdata) {
|
||||
sd_bus *bus = ASSERT_PTR(userdata);
|
||||
int r;
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
for (int i = 1; i < argc; i++) {
|
||||
r = bus_call_method(bus, bus_machine_mgr, "TerminateMachine", &error, NULL, "s", argv[i]);
|
||||
@ -1116,7 +1116,7 @@ static int copy_files(int argc, char *argv[], void *userdata) {
|
||||
bool copy_from;
|
||||
int r;
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
copy_from = streq(argv[0], "copy-from");
|
||||
dest = argv[3] ?: argv[2];
|
||||
@ -1167,7 +1167,7 @@ static int bind_mount(int argc, char *argv[], void *userdata) {
|
||||
sd_bus *bus = ASSERT_PTR(userdata);
|
||||
int r;
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
r = bus_call_method(
|
||||
bus,
|
||||
@ -1316,7 +1316,7 @@ static int login_machine(int argc, char *argv[], void *userdata) {
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP),
|
||||
"Login only supported on local machines.");
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
r = sd_event_default(&event);
|
||||
if (r < 0)
|
||||
@ -1376,7 +1376,7 @@ static int shell_machine(int argc, char *argv[], void *userdata) {
|
||||
}
|
||||
}
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
r = sd_event_default(&event);
|
||||
if (r < 0)
|
||||
@ -1595,7 +1595,7 @@ static int remove_image(int argc, char *argv[], void *userdata) {
|
||||
sd_bus *bus = ASSERT_PTR(userdata);
|
||||
int r;
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
for (int i = 1; i < argc; i++) {
|
||||
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
|
||||
@ -1623,7 +1623,7 @@ static int rename_image(int argc, char *argv[], void *userdata) {
|
||||
sd_bus *bus = ASSERT_PTR(userdata);
|
||||
int r;
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
r = bus_call_method(
|
||||
bus,
|
||||
@ -1644,7 +1644,7 @@ static int clone_image(int argc, char *argv[], void *userdata) {
|
||||
sd_bus *bus = ASSERT_PTR(userdata);
|
||||
int r;
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
r = bus_message_new_method_call(bus, &m, bus_machine_mgr, "CloneImage");
|
||||
if (r < 0)
|
||||
@ -1675,7 +1675,7 @@ static int read_only_image(int argc, char *argv[], void *userdata) {
|
||||
argv[2]);
|
||||
}
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
r = bus_call_method(bus, bus_machine_mgr, "MarkImageReadOnly", &error, NULL, "sb", argv[1], b);
|
||||
if (r < 0)
|
||||
@ -1726,7 +1726,7 @@ static int start_machine(int argc, char *argv[], void *userdata) {
|
||||
sd_bus *bus = ASSERT_PTR(userdata);
|
||||
int r;
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
ask_password_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
r = bus_wait_for_jobs_new(bus, &w);
|
||||
@ -1784,7 +1784,7 @@ static int enable_machine(int argc, char *argv[], void *userdata) {
|
||||
int r;
|
||||
bool enable;
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
enable = streq(argv[0], "enable");
|
||||
method = enable ? "EnableUnitFiles" : "DisableUnitFiles";
|
||||
@ -1878,7 +1878,7 @@ static int set_limit(int argc, char *argv[], void *userdata) {
|
||||
uint64_t limit;
|
||||
int r;
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
if (STR_IN_SET(argv[argc-1], "-", "none", "infinity"))
|
||||
limit = UINT64_MAX;
|
||||
@ -1911,7 +1911,7 @@ static int clean_images(int argc, char *argv[], void *userdata) {
|
||||
unsigned c = 0;
|
||||
int r;
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
r = bus_message_new_method_call(bus, &m, bus_machine_mgr, "CleanPool");
|
||||
if (r < 0)
|
||||
|
@ -665,7 +665,7 @@ static int start_transient_mount(
|
||||
if (r < 0)
|
||||
return bus_log_create_error(r);
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
r = sd_bus_call(bus, m, 0, &error, &reply);
|
||||
if (r < 0)
|
||||
@ -774,7 +774,7 @@ static int start_transient_automount(
|
||||
if (r < 0)
|
||||
return bus_log_create_error(r);
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
r = sd_bus_call(bus, m, 0, &error, &reply);
|
||||
if (r < 0)
|
||||
@ -932,7 +932,7 @@ static int stop_mount(
|
||||
if (r < 0)
|
||||
return bus_log_create_error(r);
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
r = sd_bus_call(bus, m, 0, &error, &reply);
|
||||
if (r < 0) {
|
||||
|
@ -1823,7 +1823,7 @@ static int start_transient_service(sd_bus *bus) {
|
||||
return r;
|
||||
slave = safe_close(slave);
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
r = bus_call_with_hint(bus, m, "service", &reply);
|
||||
if (r < 0)
|
||||
@ -2037,7 +2037,7 @@ static int start_transient_scope(sd_bus *bus) {
|
||||
return r;
|
||||
}
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
for (;;) {
|
||||
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
|
||||
@ -2352,7 +2352,7 @@ static int start_transient_trigger(sd_bus *bus, const char *suffix) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
r = bus_call_with_hint(bus, m, suffix + 1, &reply);
|
||||
if (r < 0)
|
||||
|
@ -86,7 +86,7 @@ void polkit_agent_open_maybe(void) {
|
||||
if (arg_runtime_scope != RUNTIME_SCOPE_SYSTEM)
|
||||
return;
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
}
|
||||
|
||||
int translate_bus_error_to_exit_status(int r, const sd_bus_error *error) {
|
||||
|
@ -218,7 +218,7 @@ static int set_time(int argc, char **argv, void *userdata) {
|
||||
usec_t t;
|
||||
int r;
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
r = parse_timestamp(argv[1], &t);
|
||||
if (r < 0)
|
||||
@ -242,7 +242,7 @@ static int set_timezone(int argc, char **argv, void *userdata) {
|
||||
sd_bus *bus = userdata;
|
||||
int r;
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
r = bus_call_method(bus, bus_timedate, "SetTimezone", &error, NULL, "sb", argv[1], arg_ask_password);
|
||||
if (r < 0)
|
||||
@ -256,7 +256,7 @@ static int set_local_rtc(int argc, char **argv, void *userdata) {
|
||||
sd_bus *bus = userdata;
|
||||
int r, b;
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
b = parse_boolean(argv[1]);
|
||||
if (b < 0)
|
||||
@ -288,7 +288,7 @@ static int set_ntp(int argc, char **argv, void *userdata) {
|
||||
sd_bus *bus = userdata;
|
||||
int b, r;
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
b = parse_boolean(argv[1]);
|
||||
if (b < 0)
|
||||
@ -821,7 +821,7 @@ static int verb_ntp_servers(int argc, char **argv, void *userdata) {
|
||||
if (ifindex < 0)
|
||||
return ifindex;
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
r = bus_message_new_method_call(bus, &req, bus_network_mgr, "SetLinkNTP");
|
||||
if (r < 0)
|
||||
@ -851,7 +851,7 @@ static int verb_revert(int argc, char **argv, void *userdata) {
|
||||
if (ifindex < 0)
|
||||
return ifindex;
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
r = bus_call_method(bus, bus_network_mgr, "RevertLinkNTP", &error, NULL, "i", ifindex);
|
||||
if (r < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user