mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-08-26 18:35:51 +00:00
journalctl: fix --update-catalog with not --root arg
grawity> `journalctl --update-catalog` from latest git prints:
"Recursive mkdir .: Invalid argument" and
"Failed to write : Invalid argument"
This commit is contained in:
@@ -1032,11 +1032,16 @@ int main(int argc, char *argv[]) {
|
||||
arg_action == ACTION_LIST_CATALOG ||
|
||||
arg_action == ACTION_DUMP_CATALOG) {
|
||||
|
||||
char _cleanup_free_ *database;
|
||||
database = strjoin(arg_root, "/", CATALOG_DATABASE, NULL);
|
||||
if (!database) {
|
||||
r = log_oom();
|
||||
goto finish;
|
||||
const char* database = CATALOG_DATABASE;
|
||||
char _cleanup_free_ *copy = NULL;
|
||||
if (arg_root) {
|
||||
copy = strjoin(arg_root, "/", CATALOG_DATABASE, NULL);
|
||||
if (!database) {
|
||||
r = log_oom();
|
||||
goto finish;
|
||||
}
|
||||
path_kill_slashes(copy);
|
||||
database = copy;
|
||||
}
|
||||
|
||||
if (arg_action == ACTION_UPDATE_CATALOG) {
|
||||
|
||||
Reference in New Issue
Block a user