From: Yu Watanabe Date: Fri, 23 Sep 2022 22:47:14 +0000 (+0900) Subject: networkctl: use table_add_string_line() at one more place X-Git-Tag: v252-rc1~84^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f1d07d83ab684bc92ac91f0973583e9e4de232c4;p=thirdparty%2Fsystemd.git networkctl: use table_add_string_line() at one more place --- diff --git a/src/network/networkctl.c b/src/network/networkctl.c index 410e4dfc0d4..a2e216e779b 100644 --- a/src/network/networkctl.c +++ b/src/network/networkctl.c @@ -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) {