diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-07-26 14:47:31 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-07-26 15:08:42 -0400 |
commit | 0c6ea3a4e2ac3f350dcb58e8f08bb74b030cd624 (patch) | |
tree | 562a17aa7a48741002001b59b5ad04a428890217 /src/journal/journalctl.c | |
parent | 60731f32f1d25070ed7559bdd64d65e7462a4df6 (diff) |
Add utility function to append root to path
Diffstat (limited to 'src/journal/journalctl.c')
-rw-r--r-- | src/journal/journalctl.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 5a59a3ac83..78495f8c9d 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -1614,16 +1614,12 @@ int main(int argc, char *argv[]) { arg_action == ACTION_LIST_CATALOG || arg_action == ACTION_DUMP_CATALOG) { - const char* database = CATALOG_DATABASE; - _cleanup_free_ char *copy = NULL; - if (arg_root) { - copy = strjoin(arg_root, "/", CATALOG_DATABASE, NULL); - if (!copy) { - r = log_oom(); - goto finish; - } - path_kill_slashes(copy); - database = copy; + _cleanup_free_ char *database; + + database = path_join(arg_root, CATALOG_DATABASE, NULL); + if (!database) { + r = log_oom(); + goto finish; } if (arg_action == ACTION_UPDATE_CATALOG) { |