X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fjournal%2Fjournalctl.c;h=86895b8f5b86c7cd3aaec07d356d694b534f102a;hb=c4aa09b06f835c91cea9e021df4c3605cff2318d;hp=3ae6482e99ff8b0d860ecbd2060fe7b7fb7ca31c;hpb=13cbf3a5f0cf4a1d89413d0ffc4a9067b1d6d1a8;p=elogind.git diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 3ae6482e9..86895b8f5 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -355,7 +354,7 @@ static int parse_argv(int argc, char *argv[]) { break; case ARG_INTERVAL: - r = parse_usec(optarg, &arg_interval); + r = parse_sec(optarg, &arg_interval); if (r < 0 || arg_interval <= 0) { log_error("Failed to parse sealing key change interval: %s", optarg); return -EINVAL; @@ -562,7 +561,7 @@ static int add_matches(sd_journal *j, char **args) { else if (S_ISBLK(st.st_mode)) asprintf(&t, "_KERNEL_DEVICE=b%u:%u", major(st.st_rdev), minor(st.st_rdev)); else { - log_error("File is not a device node, regular file or is not executable: %s", *i); + log_error("File is neither a device node, nor regular file, nor executable: %s", *i); return -EINVAL; } @@ -804,7 +803,7 @@ static int setup_keys(void) { fprintf(stderr, ANSI_HIGHLIGHT_OFF "\n" "The sealing key is automatically changed every %s.\n", - format_timespan(tsb, sizeof(tsb), arg_interval)); + format_timespan(tsb, sizeof(tsb), arg_interval, 0)); hn = gethostname_malloc(); @@ -878,10 +877,10 @@ static int verify(sd_journal *j) { log_info("=> Validated from %s to %s, final %s entries not sealed.", format_timestamp(a, sizeof(a), first), format_timestamp(b, sizeof(b), validated), - format_timespan(c, sizeof(c), last > validated ? last - validated : 0)); + format_timespan(c, sizeof(c), last > validated ? last - validated : 0, 0)); } else if (last > 0) log_info("=> No sealing yet, %s of entries not sealed.", - format_timespan(c, sizeof(c), last - first)); + format_timespan(c, sizeof(c), last - first, 0)); else log_info("=> No sealing yet, no entries in file."); } @@ -1032,11 +1031,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) {