From 12fff85d55fb107c675255d033ef6cce370d59e2 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 5 Jul 2023 09:19:16 +0900 Subject: [PATCH] journal-upload: make --namespace=* work Follow-up for 9f6e0bd417fa287dd1e7b541bfe0c60f04cc29e4. Note that sd_journal_open() is a simple wrapper of sd_journal_open_namespace(), hence we can merge the two branch. --- src/journal-remote/journal-upload.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/journal-remote/journal-upload.c b/src/journal-remote/journal-upload.c index 22f318f314b..404312b4d39 100644 --- a/src/journal-remote/journal-upload.c +++ b/src/journal-remote/journal-upload.c @@ -779,11 +779,9 @@ static int open_journal(sd_journal **j) { /* FIXME: replace with D-Bus call OpenMachineRootDirectory() so that things also work with raw disk images */ r = sd_journal_open_container(j, arg_machine, 0); #pragma GCC diagnostic pop - } else if (arg_namespace) - r = sd_journal_open_namespace(j, arg_namespace, (arg_merge ? 0 : SD_JOURNAL_LOCAL_ONLY) | - arg_namespace_flags | arg_journal_type); - else - r = sd_journal_open(j, (arg_merge ? 0 : SD_JOURNAL_LOCAL_ONLY) | arg_journal_type); + } else + r = sd_journal_open_namespace(j, arg_namespace, + (arg_merge ? 0 : SD_JOURNAL_LOCAL_ONLY) | arg_namespace_flags | arg_journal_type); if (r < 0) log_error_errno(r, "Failed to open %s: %m", arg_directory ?: (arg_file ? "files" : "journal")); -- 2.47.3