]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
table add table_log_show_error()
authorfangxiuning <fangxiuning123@126.com>
Tue, 7 Jul 2020 02:13:13 +0000 (10:13 +0800)
committerfangxiuning <fangxiuning123@126.com>
Wed, 8 Jul 2020 02:50:59 +0000 (10:50 +0800)
src/busctl/busctl.c
src/home/homectl.c
src/login/inhibit.c
src/login/loginctl.c
src/machine/machinectl.c
src/portable/portablectl.c
src/shared/format-table.h
src/systemctl/systemctl.c
src/timedate/timedatectl.c
src/userdb/userdbctl.c

index 3ab90de63e2ae6090987f55dff0f854bb1f98caf..f6345888171508e70e32b3d079219ab089ca4d59 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 log_error_errno(r, "Failed to show table: %m");
+                return table_log_show_error(r);
 
         return 0;
 }
index 149f960f76aaf00fc51c34c3809e9273d7a057ee..b5ad9d53d083fe3f22c591220db3dd910a7fe3ac 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 log_error_errno(r, "Failed to show table: %m");
+                        return table_log_show_error(r);
         }
 
         if (arg_legend && !arg_json) {
index a1602031b4b6af0ad359b87d63531aa0a34146d8..d82aba8ec3a3cebe417b72ffccd8b4cdb8262875 100644 (file)
@@ -138,7 +138,7 @@ static int print_inhibitors(sd_bus *bus) {
 
                 r = table_print(table, NULL);
                 if (r < 0)
-                        return log_error_errno(r, "Failed to show table: %m");
+                        return table_log_show_error(r);
         }
 
         if (arg_legend) {
index ee617929ff6745e771dc6882fa5c625b10902d5b..78dfab70716269fd0336a7a50f2f19e552aa593a 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 log_error_errno(r, "Failed to show table: %m");
+                        return table_log_show_error(r);
         }
 
         if (arg_legend) {
index f41cf464b17b3a558c32ad6d0fc48fb8658a423b..ace6439c79e40f6699a22c818fc71a7c53ea93c8 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 log_error_errno(r, "Failed to show table: %m");
+                        return table_log_show_error(r);
         }
 
         if (arg_legend) {
index 46bb0e5437fffcd698cf72e4f1bfd7e092db1a38..d4de823345ba348a89a31d0fb1b045c3b1736452 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 log_error_errno(r, "Failed to show table: %m");
+                        return table_log_show_error(r);
         }
 
         if (arg_legend) {
index 20b4ebd39b584400e129799722e095e0524a3c07..c828105f2c6073ab02c3dd2fc371ebfc09915f33 100644 (file)
@@ -130,3 +130,6 @@ 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")
index 954e5080eab977893e7607c56d3227fd875ba789..3933011c927926990590043de68c8e314254b4a6 100644 (file)
@@ -392,7 +392,7 @@ static int output_table(Table *table) {
         else
                 r = table_print(table, NULL);
         if (r < 0)
-                return log_error_errno(r, "Failed to show table: %m");
+                return table_log_show_error(r);
 
         return 0;
 }
index 96be78746d6c679541091665eb60dcdbbebcbd5b..102ffece634a904b027143c01eafeeefa5cecf0e 100644 (file)
@@ -160,7 +160,7 @@ static int print_status_info(const StatusInfo *i) {
 
         r = table_print(table, NULL);
         if (r < 0)
-                return log_error_errno(r, "Failed to show table: %m");
+                return table_log_show_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 log_error_errno(r, "Failed to show table: %m");
+                        return table_log_show_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 log_error_errno(r, "Failed to show table: %m");
+                        return table_log_show_error(r);
 
                 return 0;
         }
@@ -526,7 +526,7 @@ static int print_ntp_status_info(NTPStatusInfo *i) {
 
         r = table_print(table, NULL);
         if (r < 0)
-                log_error_errno(r, "Failed to show table: %m");
+                table_log_show_error(r);
 
         return 0;
 }
index 382a1cc9e4a6235702e868d5b566d2e2489411f3..55984518d07752f7bedb0796aaea9b2df8527149 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 log_error_errno(r, "Failed to show table: %m");
+                        return table_log_show_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 log_error_errno(r, "Failed to show table: %m");
+                        return table_log_show_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 log_error_errno(r, "Failed to show table: %m");
+                        return table_log_show_error(r);
         }
 
         return ret;