projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bca9e39
)
journalctl: properly detect empty journal files
author
Lennart Poettering
<lennart@poettering.net>
Fri, 24 Jul 2015 00:10:32 +0000
(
02:10
+0200)
committer
Lennart Poettering
<lennart@poettering.net>
Fri, 24 Jul 2015 00:10:32 +0000
(
02:10
+0200)
When we encounter a journal file with exactly zero entries, print a nice
message and exit, and don't print a weird error message.
src/journal/journalctl.c
patch
|
blob
|
history
diff --git
a/src/journal/journalctl.c
b/src/journal/journalctl.c
index
2d6ecfb
..
073cc77
100644
(file)
--- a/
src/journal/journalctl.c
+++ b/
src/journal/journalctl.c
@@
-2066,6
+2066,10
@@
int main(int argc, char *argv[]) {
log_error_errno(r, "Failed to iterate through journal: %m");
goto finish;
}
+ if (r == 0) {
+ printf("-- No entries --\n");
+ goto finish;
+ }
if (!arg_follow)
pager_open_if_enabled();