From: Yu Watanabe Date: Wed, 5 Jul 2023 00:19:16 +0000 (+0900) Subject: journal-upload: make --namespace=* work X-Git-Tag: v254-rc1~31^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=12fff85d55fb107c675255d033ef6cce370d59e2;p=thirdparty%2Fsystemd.git 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. --- 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"));