summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorfangxiuning <fangxiuning123@126.com>2020-07-08 09:16:52 +0200
committerfangxiuning <fangxiuning123@126.com>2020-07-08 09:16:52 +0200
commit4b6607d94933ff297b6893e4eb5cdc622cc97504 (patch)
treeccf24a4720c3b5181e2b82dffb6c528d5448b695 /src
parenttable add table_log_sort_error() (diff)
downloadsystemd-4b6607d94933ff297b6893e4eb5cdc622cc97504.tar.xz
systemd-4b6607d94933ff297b6893e4eb5cdc622cc97504.zip
table use table_log_print_error() instead of table_log_show_error
Diffstat (limited to 'src')
-rw-r--r--src/busctl/busctl.c2
-rw-r--r--src/home/homectl.c2
-rw-r--r--src/id128/id128.c2
-rw-r--r--src/login/inhibit.c2
-rw-r--r--src/login/loginctl.c2
-rw-r--r--src/machine/machinectl.c2
-rw-r--r--src/mount/mount-tool.c2
-rw-r--r--src/network/networkctl.c10
-rw-r--r--src/portable/portablectl.c2
-rw-r--r--src/resolve/resolvectl.c6
-rw-r--r--src/shared/format-table.h4
-rw-r--r--src/systemctl/systemctl.c2
-rw-r--r--src/timedate/timedatectl.c8
-rw-r--r--src/userdb/userdbctl.c6
14 files changed, 26 insertions, 26 deletions
diff --git a/src/busctl/busctl.c b/src/busctl/busctl.c
index f634588817..56fb8d9367 100644
--- a/src/busctl/busctl.c
+++ b/src/busctl/busctl.c
@@ -371,7 +371,7 @@ static int list_bus_names(int argc, char **argv, void *userdata) {
else
r = table_print(table, stdout);
if (r < 0)
- return table_log_show_error(r);
+ return table_log_print_error(r);
return 0;
}
diff --git a/src/home/homectl.c b/src/home/homectl.c
index 888e77bc4e..33e262706d 100644
--- a/src/home/homectl.c
+++ b/src/home/homectl.c
@@ -177,7 +177,7 @@ static int list_homes(int argc, char *argv[], void *userdata) {
else
r = table_print(table, NULL);
if (r < 0)
- return table_log_show_error(r);
+ return table_log_print_error(r);
}
if (arg_legend && !arg_json) {
diff --git a/src/id128/id128.c b/src/id128/id128.c
index 13996573ab..236043bf8a 100644
--- a/src/id128/id128.c
+++ b/src/id128/id128.c
@@ -139,7 +139,7 @@ static int verb_show(int argc, char **argv, void *userdata) {
if (table) {
r = table_print(table, NULL);
if (r < 0)
- return log_error_errno(r, "Failed to print table: %m");
+ return table_log_print_error(r);
}
return 0;
diff --git a/src/login/inhibit.c b/src/login/inhibit.c
index d5f37d8dd8..e3866eee55 100644
--- a/src/login/inhibit.c
+++ b/src/login/inhibit.c
@@ -138,7 +138,7 @@ static int print_inhibitors(sd_bus *bus) {
r = table_print(table, NULL);
if (r < 0)
- return table_log_show_error(r);
+ return table_log_print_error(r);
}
if (arg_legend) {
diff --git a/src/login/loginctl.c b/src/login/loginctl.c
index dd47ec381a..2b48a9acb7 100644
--- a/src/login/loginctl.c
+++ b/src/login/loginctl.c
@@ -100,7 +100,7 @@ static int show_table(Table *table, const char *word) {
else
r = table_print(table, NULL);
if (r < 0)
- return table_log_show_error(r);
+ return table_log_print_error(r);
}
if (arg_legend) {
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index 7c3eaad842..26fa48d870 100644
--- a/src/machine/machinectl.c
+++ b/src/machine/machinectl.c
@@ -246,7 +246,7 @@ static int show_table(Table *table, const char *word) {
else
r = table_print(table, NULL);
if (r < 0)
- return table_log_show_error(r);
+ return table_log_print_error(r);
}
if (arg_legend) {
diff --git a/src/mount/mount-tool.c b/src/mount/mount-tool.c
index 13f8a37ddf..84d5288c75 100644
--- a/src/mount/mount-tool.c
+++ b/src/mount/mount-tool.c
@@ -1436,7 +1436,7 @@ static int list_devices(void) {
r = table_print(table, NULL);
if (r < 0)
- return log_error_errno(r, "Failed to print table: %m");
+ return table_log_print_error(r);
return 0;
}
diff --git a/src/network/networkctl.c b/src/network/networkctl.c
index 3b9da74e43..cc4639aeaf 100644
--- a/src/network/networkctl.c
+++ b/src/network/networkctl.c
@@ -719,7 +719,7 @@ static int list_links(int argc, char *argv[], void *userdata) {
r = table_print(table, NULL);
if (r < 0)
- return log_error_errno(r, "Failed to print table: %m");
+ return table_log_print_error(r);
if (arg_legend)
printf("\n%i links listed.\n", c);
@@ -1064,7 +1064,7 @@ static int dump_address_labels(sd_netlink *rtnl) {
r = table_print(table, NULL);
if (r < 0)
- return log_error_errno(r, "Failed to print table: %m");
+ return table_log_print_error(r);
return 0;
}
@@ -2129,7 +2129,7 @@ static int link_status_one(
r = table_print(table, NULL);
if (r < 0)
- return log_error_errno(r, "Failed to print table: %m");
+ return table_log_print_error(r);
return show_logs(info);
}
@@ -2201,7 +2201,7 @@ static int system_status(sd_netlink *rtnl, sd_hwdb *hwdb) {
r = table_print(table, NULL);
if (r < 0)
- return log_error_errno(r, "Failed to print table: %m");
+ return table_log_print_error(r);
return show_logs(NULL);
}
@@ -2421,7 +2421,7 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
r = table_print(table, NULL);
if (r < 0)
- return log_error_errno(r, "Failed to print table: %m");
+ return table_log_print_error(r);
if (arg_legend) {
lldp_capabilities_legend(all);
diff --git a/src/portable/portablectl.c b/src/portable/portablectl.c
index 889e240ea7..aa6369864a 100644
--- a/src/portable/portablectl.c
+++ b/src/portable/portablectl.c
@@ -750,7 +750,7 @@ static int list_images(int argc, char *argv[], void *userdata) {
r = table_print(table, NULL);
if (r < 0)
- return table_log_show_error(r);
+ return table_log_print_error(r);
}
if (arg_legend) {
diff --git a/src/resolve/resolvectl.c b/src/resolve/resolvectl.c
index b40f159c76..c01524b9cc 100644
--- a/src/resolve/resolvectl.c
+++ b/src/resolve/resolvectl.c
@@ -1079,7 +1079,7 @@ static int show_statistics(int argc, char **argv, void *userdata) {
r = table_print(table, NULL);
if (r < 0)
- return log_error_errno(r, "Failed to print table: %m");
+ return table_log_print_error(r);
return 0;
}
@@ -1519,7 +1519,7 @@ static int status_ifindex(sd_bus *bus, int ifindex, const char *name, StatusMode
r = table_print(table, NULL);
if (r < 0)
- return log_error_errno(r, "Failed to print table: %m");
+ return table_log_print_error(r);
if (empty_line)
*empty_line = true;
@@ -1760,7 +1760,7 @@ static int status_global(sd_bus *bus, StatusMode mode, bool *empty_line) {
r = table_print(table, NULL);
if (r < 0)
- return log_error_errno(r, "Failed to print table: %m");
+ return table_log_print_error(r);
*empty_line = true;
diff --git a/src/shared/format-table.h b/src/shared/format-table.h
index d2fee3dbdd..1851f1d14a 100644
--- a/src/shared/format-table.h
+++ b/src/shared/format-table.h
@@ -131,8 +131,8 @@ int table_print_json(Table *t, FILE *f, JsonFormatFlags json_flags);
#define table_log_add_error(r) \
log_error_errno(r, "Failed to add cell(s) to table: %m")
-#define table_log_show_error(r) \
- log_error_errno(r, "Failed to show table: %m")
+#define table_log_print_error(r) \
+ log_error_errno(r, "Failed to print table: %m")
#define table_log_sort_error(r) \
log_error_errno(r, "Failed to sort table: %m")
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 3933011c92..c58a19a099 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -392,7 +392,7 @@ static int output_table(Table *table) {
else
r = table_print(table, NULL);
if (r < 0)
- return table_log_show_error(r);
+ return table_log_print_error(r);
return 0;
}
diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c
index 102ffece63..eaac3b3e35 100644
--- a/src/timedate/timedatectl.c
+++ b/src/timedate/timedatectl.c
@@ -160,7 +160,7 @@ static int print_status_info(const StatusInfo *i) {
r = table_print(table, NULL);
if (r < 0)
- return table_log_show_error(r);
+ return table_log_print_error(r);
if (i->rtc_local)
printf("\n%s"
@@ -433,7 +433,7 @@ static int print_ntp_status_info(NTPStatusInfo *i) {
r = table_print(table, NULL);
if (r < 0)
- return table_log_show_error(r);
+ return table_log_print_error(r);
return 0;
}
@@ -442,7 +442,7 @@ static int print_ntp_status_info(NTPStatusInfo *i) {
log_error("Invalid NTP response");
r = table_print(table, NULL);
if (r < 0)
- return table_log_show_error(r);
+ return table_log_print_error(r);
return 0;
}
@@ -526,7 +526,7 @@ static int print_ntp_status_info(NTPStatusInfo *i) {
r = table_print(table, NULL);
if (r < 0)
- table_log_show_error(r);
+ return table_log_print_error(r);
return 0;
}
diff --git a/src/userdb/userdbctl.c b/src/userdb/userdbctl.c
index 55984518d0..c973ee9c01 100644
--- a/src/userdb/userdbctl.c
+++ b/src/userdb/userdbctl.c
@@ -180,7 +180,7 @@ static int display_user(int argc, char *argv[], void *userdata) {
if (table) {
r = table_print(table, NULL);
if (r < 0)
- return table_log_show_error(r);
+ return table_log_print_error(r);
}
return ret;
@@ -330,7 +330,7 @@ static int display_group(int argc, char *argv[], void *userdata) {
if (table) {
r = table_print(table, NULL);
if (r < 0)
- return table_log_show_error(r);
+ return table_log_print_error(r);
}
return ret;
@@ -463,7 +463,7 @@ static int display_memberships(int argc, char *argv[], void *userdata) {
if (table) {
r = table_print(table, NULL);
if (r < 0)
- return table_log_show_error(r);
+ return table_log_print_error(r);
}
return ret;