]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: drop flush&check step after table printing
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Fri, 3 Apr 2026 08:59:18 +0000 (10:59 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Fri, 3 Apr 2026 11:04:40 +0000 (13:04 +0200)
Almost all callers of table_print() specify stdout or NULL (equivalent
to stdout) as the output stream. Simplify things by not requiring the
the stream to be specified.

In almost all cases, the printing of the table is surrounded by normal
printfs() that don't do explicit flushing and for which we don't check
the output stream status. Let's simplify most callers and skip this
step. The reason is not so much to avoid the extra step itself, but
instead to avoid the _handling_ of the potential failure. We generally
only want to print an error message for ENOMEM and other "internal"
errors, so strictly speaking we should filter out the errors from the
stream. By skipping the flush&check step we implicitly do this.

44 files changed:
src/ac-power/ac-power.c
src/analyze/analyze-calendar.c
src/analyze/analyze-image-policy.c
src/analyze/analyze-inspect-elf.c
src/analyze/analyze-plot.c
src/analyze/analyze-timespan.c
src/analyze/analyze-timestamp.c
src/ask-password/ask-password.c
src/binfmt/binfmt.c
src/bless-boot/bless-boot.c
src/cryptenroll/cryptenroll-list.c
src/detect-virt/detect-virt.c
src/dissect/dissect.c
src/factory-reset/factory-reset-tool.c
src/hostname/hostnamectl.c
src/id128/id128.c
src/imds/imds-tool.c
src/locale/localectl.c
src/login/loginctl.c
src/machine/machinectl.c
src/network/networkctl-address-label.c
src/network/networkctl-list.c
src/network/networkctl-lldp.c
src/network/networkctl-status-link.c
src/network/networkctl-status-system.c
src/notify/notify.c
src/portable/portablectl.c
src/report/report-basic-server.c
src/resolve/resolvectl.c
src/run/run.c
src/shared/format-table.c
src/shared/format-table.h
src/shared/libfido2-util.c
src/shared/parse-argument.c
src/shared/pkcs11-util.c
src/shared/tpm2-util.c
src/systemctl/systemctl-list-jobs.c
src/systemctl/systemctl-util.c
src/test/test-format-table.c
src/timedate/timedatectl.c
src/update-done/update-done.c
src/validatefs/validatefs.c
src/varlinkctl/varlinkctl.c
src/vpick/vpick-tool.c

index 1ca1048c5a4e9625beb0b175b4ff6ab438e101ac..b153194cdbf7eefe859b78ad0dc1a651cb466120 100644 (file)
@@ -37,7 +37,7 @@ static int help(void) {
                program_invocation_short_name,
                ansi_highlight(),
                ansi_normal());
-        table_print(options, stdout);
+        table_print(options);
 
         printf("\nSee the %s for details.\n", link);
         return 0;
index ac0b2da7d82863a1d5423a23c858a7a33bbda3cf..ea99f3871e85f1efe280e417cae8c432b6a1aea0 100644 (file)
@@ -119,7 +119,7 @@ static int test_calendar_one(usec_t n, const char *p) {
                 n = next;
         }
 
-        return table_print(table, NULL);
+        return table_print(table);
 }
 
 int verb_calendar(int argc, char *argv[], uintptr_t _data, void *userdata) {
index 93777c91a1f561a3d2d88897cde3b12455376ed6..16e69414c125061663dc3cf294115527bbae0771 100644 (file)
@@ -157,7 +157,7 @@ int verb_image_policy(int argc, char *argv[], uintptr_t _data, void *userdata) {
 
                 putc('\n', stdout);
 
-                r = table_print(table, NULL);
+                r = table_print(table);
                 if (r < 0)
                         return r;
         }
index 41dabd051c8221c10ff7d85a0fcbe21f8de724aa..f4fcc3bd5708943590a1a91944e471e0960d14d3 100644 (file)
@@ -118,7 +118,7 @@ static int analyze_elf(char **filenames, sd_json_format_flags_t json_flags) {
                 if (sd_json_format_enabled(json_flags))
                         sd_json_variant_dump(package_metadata, json_flags, stdout, NULL);
                 else {
-                        r = table_print(t, NULL);
+                        r = table_print(t);
                         if (r < 0)
                                 return table_log_print_error(r);
                 }
index 8460757b8ac89264abebfa533c96f7daefd53f38..7f92c1c6bb23e6cf7b2d4f9ce90b15416fc9107c 100644 (file)
@@ -429,7 +429,7 @@ static int show_table(Table *table, const char *word) {
                 if (sd_json_format_enabled(arg_json_format_flags))
                         r = table_print_json(table, NULL, arg_json_format_flags | SD_JSON_FORMAT_COLOR_AUTO);
                 else
-                        r = table_print(table, NULL);
+                        r = table_print(table);
                 if (r < 0)
                         return table_log_print_error(r);
         }
index fb077617d476e96f96f475d10824fcd3ef688343..b6ca7bb4af4dfbc116457ef126b845c4a98776a7 100644 (file)
@@ -55,7 +55,7 @@ int verb_timespan(int argc, char *argv[], uintptr_t _data, void *userdata) {
                 if (r < 0)
                         return table_log_add_error(r);
 
-                r = table_print(table, NULL);
+                r = table_print(table);
                 if (r < 0)
                         return r;
 
index e7ba6e1bcc1b9e42ea913de68559006edc7bf0a8..d998ca830a20a581f73b887bd0e9dc3e120c8ebe 100644 (file)
@@ -73,7 +73,7 @@ static int test_timestamp_one(const char *p) {
         if (r < 0)
                 return table_log_add_error(r);
 
-        return table_print(table, NULL);
+        return table_print(table);
 }
 
 int verb_timestamp(int argc, char *argv[], uintptr_t _data, void *userdata) {
index 2c032c1afbc7f67470c1021e6237651c47db080c..2ed2be8afee313cff13e9ecbff57b3eaebe1934d 100644 (file)
@@ -57,7 +57,7 @@ static int help(void) {
                program_invocation_short_name,
                ansi_highlight(),
                ansi_normal());
-        table_print(options, stdout);
+        table_print(options);
 
         printf("\nSee the %s for details.\n", link);
         return 0;
index 23c09fe3496e336c5918acff74b5eb544928b25d..06fff811bfb2f2eb86f6a93b4deae98d6df141a8 100644 (file)
@@ -126,7 +126,7 @@ static int help(void) {
                program_invocation_short_name,
                ansi_highlight(),
                ansi_normal());
-        table_print(options, stdout);
+        table_print(options);
 
         printf("\nSee the %s for details.\n", link);
         return 0;
index b82be92dbdf0526720ee26d97190fff84fb8f3db..67da021f2966038d419de2db519eaff2f56c0cd3 100644 (file)
@@ -58,10 +58,10 @@ static int help(void) {
                program_invocation_short_name,
                ansi_highlight(),
                ansi_normal());
-        table_print(verbs, stdout);
+        table_print(verbs);
 
         printf("\nOptions:\n");
-        table_print(options, stdout);
+        table_print(options);
 
         printf("\nSee the %s for details.\n", link);
         return 0;
index 32e8c9cf2a32be3b91db5500479fd87ebe31f0d9..bf9f2a130e94aa2d66a2019e55871afa8eba229e 100644 (file)
@@ -125,7 +125,7 @@ int list_enrolled(struct crypt_device *cd) {
                 return 0;
         }
 
-        r = table_print(t, stdout);
+        r = table_print(t);
         if (r < 0)
                 return log_error_errno(r, "Failed to show slot table: %m");
 
index 912f6fbdd67bbffd808b15588ac1a9f5ec83bae6..a8b9739a925d3b6ad5407594776f8a8a130beb59 100644 (file)
@@ -41,7 +41,7 @@ static int help(void) {
                program_invocation_short_name,
                ansi_highlight(),
                ansi_normal());
-        table_print(options, stdout);
+        table_print(options);
 
         printf("\nSee the %s for details.\n", link);
         return 0;
index 26fa1aa1a383e4ba6553c87b175da6577aaf7da7..91ad3a4502676a93a31eb7da2cfcbd118317ecf0 100644 (file)
@@ -165,11 +165,11 @@ static int help(void) {
                ansi_underline(),
                ansi_normal());
 
-        table_print(options, stdout);
+        table_print(options);
 
         printf("\n%sCommands:%s\n", ansi_underline(), ansi_normal());
 
-        table_print(commands, stdout);
+        table_print(commands);
 
         printf("\nSee the %s for details.\n", link);
         return 0;
@@ -1082,7 +1082,7 @@ static int action_dissect(
         if (!sd_json_format_enabled(arg_json_format_flags)) {
                 table_set_header(t, arg_legend);
 
-                r = table_print(t, NULL);
+                r = table_print(t);
                 if (r < 0)
                         return table_log_print_error(r);
         } else {
index e7eabd8757b957d6f811f02d39e643715fe38d59..c09369e22936aa975defd2e7e18dda572718fdad 100644 (file)
@@ -51,10 +51,10 @@ static int help(void) {
                program_invocation_short_name,
                ansi_highlight(),
                ansi_normal());
-        table_print(verbs, stdout);
+        table_print(verbs);
 
         printf("\nOptions:\n");
-        table_print(options, stdout);
+        table_print(options);
 
         printf("\nSee the %s for details.\n", link);
         return 0;
index 52fa3319d70700a56105cc3df09035ad37e901f5..52b31a58679ed66bdae65365640b2eeb7041c8d8 100644 (file)
@@ -375,7 +375,7 @@ static int print_status_info(StatusInfo *i) {
                 }
         }
 
-        r = table_print(table, NULL);
+        r = table_print(table);
         if (r < 0)
                 return table_log_print_error(r);
 
@@ -748,10 +748,10 @@ static int help(void) {
                program_invocation_short_name,
                ansi_highlight(),
                ansi_normal());
-        table_print(verbs, stdout);
+        table_print(verbs);
 
         printf("\nOptions:\n");
-        table_print(options, stdout);
+        table_print(options);
 
         printf("\nSee the %s for details.\n", link);
         return 0;
index f23403b3f811b8f4824575152e452ed38de31118..eda117aec0c4e799f7bf6a6e5f92a8065cc04ba5 100644 (file)
@@ -216,10 +216,10 @@ static int help(void) {
                program_invocation_short_name,
                ansi_highlight(),
                ansi_normal());
-        table_print(verbs, stdout);
+        table_print(verbs);
 
         printf("\nOptions:\n");
-        table_print(options, stdout);
+        table_print(options);
 
         printf("\nSee the %s for details.\n", link);
         return 0;
index 4ae8dbb33cec9adf61f0eab3239b18e4fb3ec516..61fc82014e8076a833ff201d1f543c945db1901a 100644 (file)
@@ -381,7 +381,7 @@ static int action_summary(sd_varlink *link) {
         if (table_isempty(table))
                 return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "No well-known IMDS data available.");
 
-        r = table_print(table, NULL);
+        r = table_print(table);
         if (r < 0)
                 return table_log_print_error(r);
 
index 65756d26f0d30c1d800f8574029d56b00ba6000f..b67a67e73b7d1fcf1a44955841210ec62e80d7f0 100644 (file)
@@ -144,7 +144,7 @@ static int print_status_info(StatusInfo *i) {
                         return table_log_add_error(r);
         }
 
-        r = table_print(table, NULL);
+        r = table_print(table);
         if (r < 0)
                 return table_log_print_error(r);
 
index a921a4a6771c9aaedba0c0867624de4ac1ad2b5a..fa1c02448124bb33dc99dafa9624b4e4d67aff5c 100644 (file)
@@ -716,7 +716,7 @@ static int print_session_status_info(sd_bus *bus, const char *path) {
         /* We don't use the table to show the header, in order to make the width of the column stable. */
         printf("%s%s - %s (" UID_FMT ")%s\n", ansi_highlight(), i.id, i.name, i.uid, ansi_normal());
 
-        r = table_print(table, NULL);
+        r = table_print(table);
         if (r < 0)
                 return table_log_print_error(r);
 
@@ -821,7 +821,7 @@ static int print_user_status_info(sd_bus *bus, const char *path) {
 
         printf("%s%s (" UID_FMT ")%s\n", ansi_highlight(), i.name, i.uid, ansi_normal());
 
-        r = table_print(table, NULL);
+        r = table_print(table);
         if (r < 0)
                 return table_log_print_error(r);
 
@@ -896,7 +896,7 @@ static int print_seat_status_info(sd_bus *bus, const char *path) {
 
         printf("%s%s%s\n", ansi_highlight(), i.id, ansi_normal());
 
-        r = table_print(table, NULL);
+        r = table_print(table);
         if (r < 0)
                 return table_log_print_error(r);
 
index 733b1a19ef100e714ad0790e3ab5bce8a5272010..6c684149cb957a4bd1746bf69b64af118e66911b 100644 (file)
@@ -262,7 +262,7 @@ static int show_table(Table *table, const char *word) {
                 if (OUTPUT_MODE_IS_JSON(arg_output))
                         r = table_print_json(table, NULL, output_mode_to_json_format_flags(arg_output) | SD_JSON_FORMAT_COLOR_AUTO);
                 else
-                        r = table_print(table, NULL);
+                        r = table_print(table);
                 if (r < 0)
                         return table_log_print_error(r);
         }
index f587d0cfbb542bb9d1f4374a03d80172f7aa13e4..04b6d4d2366142645f1697c6311a36e721eb58a7 100644 (file)
@@ -82,7 +82,7 @@ static int dump_address_labels(sd_netlink *rtnl) {
                         return table_log_add_error(r);
         }
 
-        r = table_print(table, NULL);
+        r = table_print(table);
         if (r < 0)
                 return table_log_print_error(r);
 
index 1ef38a0b854525d3d3f5b1ca3e572cf7ea30fe18..c30be4a1dee91245583af4b029c4b852237c9cdc 100644 (file)
@@ -79,7 +79,7 @@ int verb_list_links(int argc, char *argv[], uintptr_t _data, void *userdata) {
                         return table_log_add_error(r);
         }
 
-        r = table_print(table, NULL);
+        r = table_print(table);
         if (r < 0)
                 return table_log_print_error(r);
 
index ddce26e5c426854d150188565cd94e7b11d09e42..c91d8fea007158a32d6b78d3f1c69c4af4e6ca9b 100644 (file)
@@ -303,7 +303,7 @@ int verb_link_lldp_status(int argc, char *argv[], uintptr_t _data, void *userdat
                 }
         }
 
-        r = table_print(table, NULL);
+        r = table_print(table);
         if (r < 0)
                 return table_log_print_error(r);
 
index f63ee2d4175d7b62fd50bee0f3649910d6a9a906..9cbf3efb33210b27a3be0ac1967ee2b39b7c60a8 100644 (file)
@@ -900,7 +900,7 @@ static int link_status_one(
                on_color_operational, glyph(GLYPH_BLACK_CIRCLE), off_color_operational,
                info->ifindex, info->name);
 
-        r = table_print(table, NULL);
+        r = table_print(table);
         if (r < 0)
                 return table_log_print_error(r);
 
index 20a4c2be9186f099324c6d80446843b8b962b351..ce403d60624e34514d5db65c47787bff85954108 100644 (file)
@@ -126,7 +126,7 @@ int system_status(sd_netlink *rtnl, sd_hwdb *hwdb) {
                on_color_operational, glyph(GLYPH_BLACK_CIRCLE), off_color_operational,
                strna(netifs_joined));
 
-        r = table_print(table, NULL);
+        r = table_print(table);
         if (r < 0)
                 return table_log_print_error(r);
 
index a06f5ce7734e31520a95142af5a60fe5c71e5db9..e425a125ac3ae12529649eed3bd410b7f519cd98 100644 (file)
@@ -77,7 +77,7 @@ static int help(void) {
                ansi_highlight(),
                ansi_normal());
 
-        table_print(options, stdout);
+        table_print(options);
 
         printf("\nSee the %s for details.\n", link);
         return 0;
index 0cd461a997e23b0c65f503e0df39295d8861a55b..f5ce3db9c41e370781242a3e1b46e347343939a8 100644 (file)
@@ -1075,7 +1075,7 @@ static int verb_list_images(int argc, char *argv[], uintptr_t _data, void *userd
 
                 table_set_header(table, arg_legend);
 
-                r = table_print(table, NULL);
+                r = table_print(table);
                 if (r < 0)
                         return table_log_print_error(r);
         }
index 32ec9b035600b1109cf82093f164f0d54c513b23..dc482a37ff0ba70e737afb616964cb5403a4bc80 100644 (file)
@@ -47,7 +47,7 @@ static int help(void) {
                ansi_normal(),
                ansi_underline(),
                ansi_normal());
-        table_print(options, stdout);
+        table_print(options);
 
         return 0;
 }
index e4705a6bccc7646bff62cbb77b62570f8d8d48f5..fe2b676c7c0dc81a8fc4c33a4ff52d1d88f6200b 100644 (file)
@@ -1321,7 +1321,7 @@ static int verb_show_statistics(int argc, char *argv[], uintptr_t _data, void *u
         if (r < 0)
                 return table_log_add_error(r);
 
-        r = table_print(table, NULL);
+        r = table_print(table);
         if (r < 0)
                 return table_log_print_error(r);
 
@@ -1890,7 +1890,7 @@ static int print_configuration(DNSConfiguration *configuration, StatusMode mode,
                         return table_log_add_error(r);
         }
 
-        r = table_print(table, NULL);
+        r = table_print(table);
         if (r < 0)
                 return table_log_print_error(r);
 
@@ -3097,7 +3097,7 @@ static int dump_server_state(sd_json_variant *server) {
         if (r < 0)
                 return table_log_add_error(r);
 
-        r = table_print(table, NULL);
+        r = table_print(table);
         if (r < 0)
                 return table_log_print_error(r);
 
index f1bbbe1f393c2dafd582b46addac272c2a0fda70..88a9f41d69a3aa5511a5eb3aa4d690381c31447a 100644 (file)
@@ -2437,7 +2437,7 @@ static int run_context_show_result(RunContext *c) {
                         return table_log_add_error(r);
         }
 
-        r = table_print(t, stderr);
+        r = table_print_full(t, stderr, /* flush= */ true);
         if (r < 0)
                 return table_log_print_error(r);
 
index 04552b5b567761e1992514a04be79ce6b2b45b9f..718d5c09b860a1f3c8a45c1a3c2c9280500bd5f9 100644 (file)
@@ -2217,7 +2217,7 @@ int _table_sync_column_widths(size_t column, Table *a, ...) {
         return r;
 }
 
-int table_print(Table *t, FILE *f) {
+int table_print_full(Table *t, FILE *f, bool flush) {
         size_t n_rows, *minimum_width, *maximum_width, display_columns, *requested_width,
                 table_minimum_width, table_maximum_width, table_requested_width, table_effective_width,
                 *width = NULL;
@@ -2637,6 +2637,9 @@ int table_print(Table *t, FILE *f) {
                 } while (more_sublines);
         }
 
+        if (!flush)
+                return 0;
+
         return fflush_and_check(f);
 }
 
@@ -2652,7 +2655,7 @@ int table_format(Table *t, char **ret) {
         if (!f)
                 return -ENOMEM;
 
-        r = table_print(t, f);
+        r = table_print_full(t, f, /* flush= */ true);
         if (r < 0)
                 return r;
 
@@ -3141,7 +3144,7 @@ int table_print_json(Table *t, FILE *f, sd_json_format_flags_t flags) {
         assert(t);
 
         if (!sd_json_format_enabled(flags)) /* If JSON output is turned off, use regular output */
-                return table_print(t, f);
+                return table_print_full(t, f, /* flush= */ true);
 
         if (!f)
                 f = stdout;
index bb5a68b7e9fa35c90c60249c0a2c11b614b7369a..ee4007394ef0f5723ae9b30fe31b0f0a24a9a7aa 100644 (file)
@@ -147,7 +147,11 @@ int table_set_column_width(Table *t, size_t column, size_t width);
 int _table_sync_column_widths(size_t column, Table *a, ...);
 #define table_sync_column_widths(column, a, ...) _table_sync_column_widths(column, a, __VA_ARGS__, NULL)
 
-int table_print(Table *t, FILE *f);
+int table_print_full(Table *t, FILE *f, bool flush);
+static inline int table_print(Table *t) {
+        return table_print_full(t, /* f= */ NULL, /* flush= */ false);
+}
+
 int table_format(Table *t, char **ret);
 
 static inline TableCell* TABLE_HEADER_CELL(size_t i) {
index f4c8ad5c8616ec7b467b08f3d3adeb38c5129b1b..7e50d0dd2df570427dddbca733d9a75faaa37826 100644 (file)
@@ -1241,7 +1241,7 @@ int fido2_list_devices(void) {
                 }
         }
 
-        r = table_print(t, stdout);
+        r = table_print(t);
         if (r < 0) {
                 log_error_errno(r, "Failed to show device table: %m");
                 goto finish;
index 39e5328e7037ef5761ae6df3c978a8a9647149a0..6ac42c4d88407cde7bd3290bbf01e50211f4bf97 100644 (file)
@@ -128,7 +128,7 @@ int parse_signal_argument(const char *s, int *ret) {
                                 return table_log_add_error(r);
                 }
 
-                r = table_print(table, NULL);
+                r = table_print(table);
                 if (r < 0)
                         return table_log_print_error(r);
 
index 1fa0d77d6d004b4573618f3f6a40b699440b5d70..2d8ce29b5803e7a25847e2268c5c7723bd89ff30 100644 (file)
@@ -1816,7 +1816,7 @@ int pkcs11_list_tokens(void) {
                 return 0;
         }
 
-        r = table_print(t, stdout);
+        r = table_print(t);
         if (r < 0)
                 return log_error_errno(r, "Failed to show device table: %m");
 
index dc062117b414a2a94b02e5bdeec67b3f41247ed6..a1f05d6397c5eb340e8742a0415ef3e64fc55090 100644 (file)
@@ -6584,7 +6584,7 @@ int tpm2_list_devices(bool legend, bool quiet) {
                 return 0;
         }
 
-        r = table_print(t, stdout);
+        r = table_print(t);
         if (r < 0)
                 return log_error_errno(r, "Failed to show device table: %m");
 
index 5804d32518c6eca6b3a92e0ef400af607b969f55..bf3f5ed8662aad4d44f36ac97f53a21b206402de 100644 (file)
@@ -115,7 +115,7 @@ static int output_jobs_list(sd_bus *bus, const struct job_info* jobs, unsigned n
                         output_waiting_jobs(bus, table, j->id, "GetJobBefore", "\twaiting for job");
         }
 
-        r = table_print(table, NULL);
+        r = table_print(table);
         if (r < 0)
                 return log_error_errno(r, "Failed to print the table: %m");
 
index ef7bce9e7f1cc8ec63bf74caa184caf8125e6ac8..b278f784ba3eceb0a7daa3eb7d03002a6f00555d 100644 (file)
@@ -919,7 +919,7 @@ int output_table(Table *table) {
         if (OUTPUT_MODE_IS_JSON(arg_output))
                 r = table_print_json(table, NULL, output_mode_to_json_format_flags(arg_output) | SD_JSON_FORMAT_COLOR_AUTO);
         else
-                r = table_print(table, NULL);
+                r = table_print(table);
         if (r < 0)
                 return table_log_print_error(r);
 
index 4305f77224e66e46b8003416736900fe79a948d9..677adaa9c964d28505e8f43838dc55e9509046e2 100644 (file)
@@ -890,7 +890,7 @@ TEST(table_ansi) {
                      "FOO   BAR            BAZ    KKK\n"
                      "hallo knuerzredgreen noansi thisisgrey\n");
 
-        ASSERT_OK(table_print(table, /* f= */ NULL));
+        ASSERT_OK(table_print(table));
 
         _cleanup_(sd_json_variant_unrefp) sd_json_variant *j = NULL, *jj = NULL;
 
index cec4363affbbbcebc9d6228e0a4a4b95b2c95fd5..93a5dd6da359b2eab71981ac72593f5e593d43ad 100644 (file)
@@ -163,7 +163,7 @@ static int print_status_info(const StatusInfo *i) {
         if (r < 0)
                 return table_log_add_error(r);
 
-        r = table_print(table, NULL);
+        r = table_print(table);
         if (r < 0)
                 return table_log_print_error(r);
 
@@ -443,7 +443,7 @@ static int print_ntp_status_info(NTPStatusInfo *i) {
                 if (r < 0)
                         return table_log_add_error(r);
 
-                r = table_print(table, NULL);
+                r = table_print(table);
                 if (r < 0)
                         return table_log_print_error(r);
 
@@ -452,7 +452,7 @@ static int print_ntp_status_info(NTPStatusInfo *i) {
 
         if (i->dest < i->origin || i->trans < i->recv || i->dest - i->origin < i->trans - i->recv) {
                 log_error("Invalid NTP response");
-                r = table_print(table, NULL);
+                r = table_print(table);
                 if (r < 0)
                         return table_log_print_error(r);
 
@@ -536,7 +536,7 @@ static int print_ntp_status_info(NTPStatusInfo *i) {
                         return table_log_add_error(r);
         }
 
-        r = table_print(table, NULL);
+        r = table_print(table);
         if (r < 0)
                 return table_log_print_error(r);
 
index b3c45c352b98da0751fa17462c879ea2e95621e8..f076f263a6880d4ce895ab55e227825691f3e75a 100644 (file)
@@ -82,7 +82,7 @@ static int help(void) {
                ansi_normal(),
                ansi_underline(),
                ansi_normal());
-        table_print(options, stdout);
+        table_print(options);
 
         printf("\nSee the %s for details.\n", link);
         return 0;
index 9645fd187fe50f301801b0cbeff990e4b5490802..0608a1489520baea445a110216b5fbf1a4bba797 100644 (file)
@@ -50,7 +50,7 @@ static int help(void) {
                program_invocation_short_name,
                ansi_highlight(),
                ansi_normal());
-        table_print(options, stdout);
+        table_print(options);
 
         printf("\nSee the %s for details.\n", link);
         return 0;
index c2cdd52b89ea63e0980961c37c5152cdc237c119..2d610db4e5500ed3a5a0ad01efb1c6811f5b51f3 100644 (file)
@@ -439,7 +439,7 @@ static int verb_info(int argc, char *argv[], uintptr_t _data, void *userdata) {
                         if (r < 0)
                                 return table_log_add_error(r);
 
-                        r = table_print(t, NULL);
+                        r = table_print(t);
                         if (r < 0)
                                 return table_log_print_error(r);
                 }
index c20994d115dd5ca9b731de78383040fa81c803cb..1f3277da45e6d308a2bf92c979c3b574f7b6a419 100644 (file)
@@ -337,7 +337,7 @@ static int run(int argc, char *argv[]) {
                                         return table_log_add_error(r);
                         }
 
-                        r = table_print(t, stdout);
+                        r = table_print(t);
                         if (r < 0)
                                 return table_log_print_error(r);