blob: ed0db4f238b601dca457d03e775295676767ce00 [file] [log] [blame]
Tomáš Pecka5e070252022-05-20 20:41:21 +02001From d17ff9b2b0f3f0d2bfb54f9e3e965874e6df1974 Mon Sep 17 00:00:00 2001
Tomáš Peckaae301762021-10-13 10:50:37 +02002From: Tomas Pecka <peckato1@users.noreply.github.com>
3Date: Thu, 7 Oct 2021 14:11:45 +0200
4Subject: [PATCH 5/9] networkctl: lldp uses table_empty_string instead of strna
5
6---
7 src/network/networkctl.c | 13 ++++++++-----
8 1 file changed, 8 insertions(+), 5 deletions(-)
9
10diff --git a/src/network/networkctl.c b/src/network/networkctl.c
Václav Kubernát8cd61562021-12-08 13:27:31 +010011index 68dd4b185c..30cd75eec0 100644
Tomáš Peckaae301762021-10-13 10:50:37 +020012--- a/src/network/networkctl.c
13+++ b/src/network/networkctl.c
Václav Kubernát8cd61562021-12-08 13:27:31 +010014@@ -2529,6 +2529,9 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
Tomáš Peckaae301762021-10-13 10:50:37 +020015 assert_se(cell = table_get_cell(table, 0, 5));
16 table_set_minimum_width(table, cell, 16);
17
18+ if (table_set_empty_string(table, "n/a") < 0)
19+ return log_oom();
20+
21 for (int i = 0; i < c; i++) {
22 _cleanup_fclose_ FILE *f = NULL;
23
Václav Kubernát8cd61562021-12-08 13:27:31 +010024@@ -2590,11 +2593,11 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
Tomáš Peckaae301762021-10-13 10:50:37 +020025
26 r = table_add_many(table,
27 TABLE_STRING, links[i].name,
28- TABLE_STRING, strna(chassis_id),
29- TABLE_STRING, strna(system_name),
30- TABLE_STRING, strna(capabilities),
31- TABLE_STRING, strna(port_id),
32- TABLE_STRING, strna(port_description));
33+ TABLE_STRING, chassis_id,
34+ TABLE_STRING, system_name,
35+ TABLE_STRING, capabilities,
36+ TABLE_STRING, port_id,
37+ TABLE_STRING, port_description);
38 if (r < 0)
39 return table_log_add_error(r);
40
41--
Tomáš Pecka5e070252022-05-20 20:41:21 +0200422.35.1
Tomáš Peckaae301762021-10-13 10:50:37 +020043