]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
table use table_log_print_error() instead of table_log_show_error 16385/head
authorfangxiuning <fangxiuning123@126.com>
Wed, 8 Jul 2020 07:16:52 +0000 (15:16 +0800)
committerfangxiuning <fangxiuning123@126.com>
Wed, 8 Jul 2020 07:16:52 +0000 (15:16 +0800)
14 files changed:
src/busctl/busctl.c
src/home/homectl.c
src/id128/id128.c
src/login/inhibit.c
src/login/loginctl.c
src/machine/machinectl.c
src/mount/mount-tool.c
src/network/networkctl.c
src/portable/portablectl.c
src/resolve/resolvectl.c
src/shared/format-table.h
src/systemctl/systemctl.c
src/timedate/timedatectl.c
src/userdb/userdbctl.c

index f6345888171508e70e32b3d079219ab089ca4d59..56fb8d936760802d8f26d8045b5af3cbcb05ec8c 100644 (file)
@@ -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;
 }
index 888e77bc4e89ad6a9ba57d1d99913909c69cc603..33e262706d29350f6bd63cbaf732595108e3fe04 100644 (file)
@@ -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) {
index 13996573ab6661ef080f2a43eb7bc2228e027763..236043bf8a4c06c7aec0f2bc1405cc0977fb8f47 100644 (file)
@@ -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;
index d5f37d8dd8153bddbf2496341e036ac717b597db..e3866eee55a711010362c229c8ed80b50e669aac 100644 (file)
@@ -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) {
index dd47ec381a5e39c16ed7ebf8007ec536b6852e07..2b48a9acb792c52e079e1d83ddd1b9ea5c7434d8 100644 (file)
@@ -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) {
index 7c3eaad842a949ca34d1eb32fc2b0a56f93c3250..26fa48d870c1dacb73ba915ccf988d2ee74831f0 100644 (file)
@@ -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) {
index 13f8a37ddf2353778060c6d895d898e8fa394faf..84d5288c75e14c33a94adc2532fe5f5cdcf5760a 100644 (file)
@@ -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;
 }
index 3b9da74e431d91e713205a1580c01a85da98eaaa..cc4639aeaf73c177e8b97e57c4725bb4df1aa069 100644 (file)
@@ -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);
index 889e240ea756839f6b62f823c7483a60261aa5bc..aa6369864a4e4240cdbded6083d3cb5111ee8f36 100644 (file)
@@ -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) {
index b40f159c76df5789e015baec1d125ceea5638edf..c01524b9cc5a3a6c3fa6efbc756402c5a8d0adb4 100644 (file)
@@ -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;
 
index d2fee3dbddcf10ae4d7c1ab13340350ef3c18a59..1851f1d14a22a56e01427763c3926255ead3072c 100644 (file)
@@ -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")
index 3933011c927926990590043de68c8e314254b4a6..c58a19a099d0780a099c93cf044854842cc75753 100644 (file)
@@ -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;
 }
index 102ffece634a904b027143c01eafeeefa5cecf0e..eaac3b3e35554449698ab4876bd608e44afe407e 100644 (file)
@@ -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;
 }
index 55984518d07752f7bedb0796aaea9b2df8527149..c973ee9c0114e27a0390f5a2904ac51a45d3ae72 100644 (file)
@@ -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;