mirror of
https://github.com/systemd/systemd.git
synced 2024-11-05 23:51:28 +03:00
timedatectl: drop ifindex output parameter too
This commit is contained in:
parent
597da51bae
commit
9030b50a7b
@ -829,7 +829,7 @@ static int show_timesync(int argc, char **argv, void *userdata) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int parse_ifindex_bus(sd_bus *bus, const char *str, int *ret) {
|
static int parse_ifindex_bus(sd_bus *bus, const char *str) {
|
||||||
_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;
|
||||||
_cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
|
_cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
|
||||||
int32_t i;
|
int32_t i;
|
||||||
@ -837,14 +837,11 @@ static int parse_ifindex_bus(sd_bus *bus, const char *str, int *ret) {
|
|||||||
|
|
||||||
assert(bus);
|
assert(bus);
|
||||||
assert(str);
|
assert(str);
|
||||||
assert(ret);
|
|
||||||
|
|
||||||
r = parse_ifindex(str);
|
r = parse_ifindex(str);
|
||||||
if (r >= 0) {
|
if (r > 0)
|
||||||
assert(r != 0);
|
return r;
|
||||||
*ret = r;
|
assert(r < 0);
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
r = sd_bus_call_method(
|
r = sd_bus_call_method(
|
||||||
bus,
|
bus,
|
||||||
@ -862,8 +859,7 @@ static int parse_ifindex_bus(sd_bus *bus, const char *str, int *ret) {
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return bus_log_create_error(r);
|
return bus_log_create_error(r);
|
||||||
|
|
||||||
*ret = i;
|
return i;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int verb_ntp_servers(int argc, char **argv, void *userdata) {
|
static int verb_ntp_servers(int argc, char **argv, void *userdata) {
|
||||||
@ -874,9 +870,9 @@ static int verb_ntp_servers(int argc, char **argv, void *userdata) {
|
|||||||
|
|
||||||
assert(bus);
|
assert(bus);
|
||||||
|
|
||||||
r = parse_ifindex_bus(bus, argv[1], &ifindex);
|
ifindex = parse_ifindex_bus(bus, argv[1]);
|
||||||
if (r < 0)
|
if (ifindex < 0)
|
||||||
return r;
|
return ifindex;
|
||||||
|
|
||||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||||
|
|
||||||
@ -912,9 +908,9 @@ static int verb_revert(int argc, char **argv, void *userdata) {
|
|||||||
|
|
||||||
assert(bus);
|
assert(bus);
|
||||||
|
|
||||||
r = parse_ifindex_bus(bus, argv[1], &ifindex);
|
ifindex = parse_ifindex_bus(bus, argv[1]);
|
||||||
if (r < 0)
|
if (ifindex < 0)
|
||||||
return r;
|
return ifindex;
|
||||||
|
|
||||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user