diff options
Diffstat (limited to 'src/journal/journalctl.c')
-rw-r--r-- | src/journal/journalctl.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 76ec0827e7..073cc77711 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -1719,7 +1719,7 @@ static int access_check(sd_journal *j) { static int flush_to_var(void) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; - _cleanup_bus_close_unref_ sd_bus *bus = NULL; + _cleanup_bus_flush_close_unref_ sd_bus *bus = NULL; _cleanup_close_ int watch_fd = -1; int r; @@ -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(); |