mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 08:56:15 +09:00
journal-upload: make --namespace=* work
Follow-up for 9f6e0bd417.
Note that sd_journal_open() is a simple wrapper of sd_journal_open_namespace(),
hence we can merge the two branch.
This commit is contained in:
@@ -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"));
|
||||
|
||||
Reference in New Issue
Block a user