From: Lennart Poettering Date: Tue, 26 Nov 2019 10:24:33 +0000 (+0100) Subject: journalctl: use an anonymous array when an array is needed X-Git-Tag: v245-rc1~41^2~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=33ff74643e2a492e5bf29214615ba617c1984156;p=thirdparty%2Fsystemd.git journalctl: use an anonymous array when an array is needed I am pretty sure this makes things more readable, since the expected argument here is actually an array. --- diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 3ab79d11a51..6a449864133 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -2104,10 +2104,9 @@ int main(int argc, char *argv[]) { r = sd_journal_open_directory(&j, arg_directory, arg_journal_type); else if (arg_root) r = sd_journal_open_directory(&j, arg_root, arg_journal_type | SD_JOURNAL_OS_ROOT); - else if (arg_file_stdin) { - int ifd = STDIN_FILENO; - r = sd_journal_open_files_fd(&j, &ifd, 1, 0); - } else if (arg_file) + else if (arg_file_stdin) + r = sd_journal_open_files_fd(&j, (int[]) { STDIN_FILENO }, 1, 0); + else if (arg_file) r = sd_journal_open_files(&j, (const char**) arg_file, 0); else if (arg_machine) { _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;