summaryrefslogtreecommitdiff
path: root/src/journal/journalctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/journal/journalctl.c')
-rw-r--r--src/journal/journalctl.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index eb79c4d853..de972a17db 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -1288,11 +1288,10 @@ int main(int argc, char *argv[]) {
log_error("Failed to iterate through journal: %s", strerror(-r));
goto finish;
}
+ if (r == 0)
+ break;
}
- if (r == 0)
- break;
-
if (arg_until_set && !arg_reverse) {
usec_t usec;
@@ -1338,10 +1337,12 @@ int main(int argc, char *argv[]) {
arg_catalog * OUTPUT_CATALOG;
r = output_journal(stdout, j, arg_output, 0, flags);
- if (r < 0 || ferror(stdout))
+ need_seek = true;
+ if (r == -EADDRNOTAVAIL)
+ break;
+ else if (r < 0 || ferror(stdout))
goto finish;
- need_seek = true;
n_shown++;
}