]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journalctl-show: check Context.has_cursor rather than arg_*
authorMike Yuan <me@yhndnzj.com>
Tue, 13 May 2025 20:55:15 +0000 (22:55 +0200)
committerMike Yuan <me@yhndnzj.com>
Tue, 13 May 2025 20:55:15 +0000 (22:55 +0200)
src/journal/journalctl-show.c

index f2b43a7f3e99514bd60d3081af07cf7a52394867..20b39da62de40b5844be8cd6a7aec3b66352b5e4 100644 (file)
@@ -313,7 +313,7 @@ static int on_first_event(sd_event_source *s, void *userdata) {
         if (r < 0)
                 return r;
 
-        if (arg_follow && !arg_reverse && !arg_cursor && !arg_after_cursor && !arg_cursor_file && !arg_since_set) {
+        if (arg_follow && !arg_reverse && !c->has_cursor && !arg_since_set) {
                 r = sd_journal_get_cursor(c->journal, /* ret_cursor= */ NULL);
                 if (r == -EADDRNOTAVAIL) {
                         /* If we shall operate in --follow mode, and we are unable to get a cursor after