1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-05 15:21:37 +03:00

journalctl: Correctly handle --show-cursor in combination with --until or --since and --reverse

This commit is contained in:
Timo Schlüßler 2020-01-13 09:09:45 +00:00 committed by Lennart Poettering
parent 575a915a74
commit 3ac9cac7f7

View File

@ -2514,7 +2514,7 @@ int main(int argc, char *argv[]) {
goto finish; goto finish;
} }
if (usec > arg_until) if (usec > arg_until)
goto finish; break;
} }
if (arg_since_set && arg_reverse) { if (arg_since_set && arg_reverse) {
@ -2526,7 +2526,7 @@ int main(int argc, char *argv[]) {
goto finish; goto finish;
} }
if (usec < arg_since) if (usec < arg_since)
goto finish; break;
} }
if (!arg_merge && !arg_quiet) { if (!arg_merge && !arg_quiet) {
@ -2632,6 +2632,17 @@ int main(int argc, char *argv[]) {
if (!arg_follow) { if (!arg_follow) {
if (n_shown == 0 && !arg_quiet) if (n_shown == 0 && !arg_quiet)
printf("-- No entries --\n"); printf("-- No entries --\n");
break;
}
fflush(stdout);
r = wait_for_change(j, poll_fd);
if (r < 0)
goto finish;
first_line = false;
}
if (arg_show_cursor || arg_cursor_file) { if (arg_show_cursor || arg_cursor_file) {
_cleanup_free_ char *cursor = NULL; _cleanup_free_ char *cursor = NULL;
@ -2655,18 +2666,6 @@ int main(int argc, char *argv[]) {
} }
} }
break;
}
fflush(stdout);
r = wait_for_change(j, poll_fd);
if (r < 0)
goto finish;
first_line = false;
}
finish: finish:
pager_close(); pager_close();