X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fjournal%2Fjournalctl.c;h=5c4a71d618248521fb4fabc1d868ca2722c69c1f;hb=54cba0b16cdc94d5c21e8d805a4ade1255d43bc9;hp=5a59a3ac83f41ee71c8d1cb84c60d664ec3fe896;hpb=7de80bfe2e61d5818601ccfddbadad3b7703ed70;p=elogind.git diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 5a59a3ac8..5c4a71d61 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -40,7 +40,7 @@ #include "acl-util.h" #endif -#include +#include "systemd/sd-journal.h" #include "log.h" #include "logs-show.h" @@ -160,7 +160,7 @@ static int parse_boot_descriptor(const char *x, sd_id128_t *boot_id, int *offset return 0; } -static int help(void) { +static void help(void) { pager_open_if_enabled(); @@ -218,8 +218,6 @@ static int help(void) { " --verify Verify journal file consistency\n" #endif , program_invocation_short_name); - - return 0; } static int parse_argv(int argc, char *argv[]) { @@ -306,12 +304,13 @@ static int parse_argv(int argc, char *argv[]) { assert(argc >= 0); assert(argv); - while ((c = getopt_long(argc, argv, "hefo:aln::qmb::kD:p:c:u:F:xrM:", options, NULL)) >= 0) { + while ((c = getopt_long(argc, argv, "hefo:aln::qmb::kD:p:c:u:F:xrM:", options, NULL)) >= 0) switch (c) { case 'h': - return help(); + help(); + return 0; case ARG_VERSION: puts(PACKAGE_STRING); @@ -633,7 +632,6 @@ static int parse_argv(int argc, char *argv[]) { default: assert_not_reached("Unhandled option"); } - } if (arg_follow && !arg_no_tail && arg_lines < 0) arg_lines = 10; @@ -1614,16 +1612,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) {