From: Yu Watanabe Date: Tue, 19 Mar 2024 10:04:10 +0000 (+0900) Subject: journalctl: use correct type for flags X-Git-Tag: v256-rc1~397^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=adc8a60b880422976096d779c84b5f3d59555689;p=thirdparty%2Fsystemd.git journalctl: use correct type for flags This also moves its declaration, as it is not changed in the loop. --- diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 19b4f076c1c..2d44e95e290 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);