mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-28 17:47:05 +03:00
networkctl: use table_add_string_line() at one more place
This commit is contained in:
parent
8f60c998ab
commit
f1d07d83ab
@ -1569,6 +1569,10 @@ static int link_status_one(
|
||||
(void) sd_network_link_get_route_domains(info->ifindex, &route_domains);
|
||||
(void) sd_network_link_get_ntp(info->ifindex, &ntp);
|
||||
(void) sd_network_link_get_sip(info->ifindex, &sip);
|
||||
(void) sd_network_link_get_network_file(info->ifindex, &network);
|
||||
(void) sd_network_link_get_carrier_bound_to(info->ifindex, &carrier_bound_to);
|
||||
(void) sd_network_link_get_carrier_bound_by(info->ifindex, &carrier_bound_by);
|
||||
(void) sd_network_link_get_activation_policy(info->ifindex, &activation_policy);
|
||||
|
||||
if (info->sd_device) {
|
||||
(void) sd_device_get_property_value(info->sd_device, "ID_NET_LINK_FILE", &link);
|
||||
@ -1586,11 +1590,6 @@ static int link_status_one(
|
||||
if (r == -ENOMEM)
|
||||
return log_oom();
|
||||
|
||||
(void) sd_network_link_get_network_file(info->ifindex, &network);
|
||||
|
||||
(void) sd_network_link_get_carrier_bound_to(info->ifindex, &carrier_bound_to);
|
||||
(void) sd_network_link_get_carrier_bound_by(info->ifindex, &carrier_bound_by);
|
||||
|
||||
char lease_file[STRLEN("/run/systemd/netif/leases/") + DECIMAL_STR_MAX(int)];
|
||||
xsprintf(lease_file, "/run/systemd/netif/leases/%i", info->ifindex);
|
||||
|
||||
@ -2184,15 +2183,9 @@ static int link_status_one(
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = sd_network_link_get_activation_policy(info->ifindex, &activation_policy);
|
||||
if (r >= 0) {
|
||||
r = table_add_many(table,
|
||||
TABLE_EMPTY,
|
||||
TABLE_STRING, "Activation Policy:",
|
||||
TABLE_STRING, activation_policy);
|
||||
if (r < 0)
|
||||
return table_log_add_error(r);
|
||||
}
|
||||
r = table_add_string_line(table, "Activation Policy:", activation_policy);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = sd_network_link_get_required_for_online(info->ifindex);
|
||||
if (r >= 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user