From adc8a60b880422976096d779c84b5f3d59555689 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 19 Mar 2024 19:04:10 +0900 Subject: [PATCH] journalctl: use correct type for flags This also moves its declaration, as it is not changed in the loop. --- src/journal/journalctl.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 19b4f076c1..2d44e95e29 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -2088,8 +2088,16 @@ static int show(Context *c) { j = ASSERT_PTR(c->journal); + OutputFlags flags = + arg_all * OUTPUT_SHOW_ALL | + arg_full * OUTPUT_FULL_WIDTH | + colors_enabled() * OUTPUT_COLOR | + arg_catalog * OUTPUT_CATALOG | + arg_utc * OUTPUT_UTC | + arg_truncate_newline * OUTPUT_TRUNCATE_NEWLINE | + arg_no_hostname * OUTPUT_NO_HOSTNAME; + while (arg_lines < 0 || n_shown < arg_lines || arg_follow) { - int flags; size_t highlight[2] = {}; if (c->need_seek) { @@ -2180,15 +2188,6 @@ static int show(Context *c) { } } - flags = - arg_all * OUTPUT_SHOW_ALL | - arg_full * OUTPUT_FULL_WIDTH | - colors_enabled() * OUTPUT_COLOR | - arg_catalog * OUTPUT_CATALOG | - arg_utc * OUTPUT_UTC | - arg_truncate_newline * OUTPUT_TRUNCATE_NEWLINE | - arg_no_hostname * OUTPUT_NO_HOSTNAME; - r = show_journal_entry(stdout, j, arg_output, 0, flags, arg_output_fields, highlight, &c->ellipsized, &c->previous_ts_output, &c->previous_boot_id_output);