summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
authorJan Synacek <jsynacek@redhat.com>2016-02-01 09:25:22 +0100
committerJan Synacek <jsynacek@redhat.com>2016-02-01 11:59:33 +0100
commit0f1a9a830c87d8accdc3a44d0a93ad343e52a7bd (patch)
tree78d9c651f9c9c1cfe4e79fa525a69b0f9cf880b2 /src/journal
parent39fd5b08a73f144a20202a665bd25cad51d8a90b (diff)
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.
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/journalctl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index db11421e7a..69a2013df8 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);