From: Jan Synacek Date: Mon, 1 Feb 2016 08:25:22 +0000 (+0100) Subject: journalctl: show friendly info when using -b on runtime journal only X-Git-Tag: v231~694^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0f1a9a830c87d8accdc3a44d0a93ad343e52a7bd;p=platform%2Fupstream%2Fsystemd.git journalctl: show friendly info when using -b on runtime journal only Make it clear that specifing boot when there is actually only one has no effect. This cosmetic patch improves user experience a bit. --- diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index db11421..69a2013 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -2091,6 +2091,13 @@ int main(int argc, char *argv[]) { assert_not_reached("Unknown action"); } + if (arg_boot_offset != 0 && + sd_journal_has_runtime_files(j) > 0 && + sd_journal_has_persistent_files(j) == 0) { + log_info("Specifying boot ID has no effect, no persistent journal was found"); + r = 0; + goto finish; + } /* add_boot() must be called first! * It may need to seek the journal to find parent boot IDs. */ r = add_boot(j);