diff options
author | Wesley Dawson <whd@mozilla.com> | 2014-11-30 23:27:00 -0800 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-12-09 02:40:16 +0100 |
commit | 8ee8e53648bf45854d92b60e1e70c17a0cec3c3d (patch) | |
tree | 9bb74da1373b76a67c576ed9e84c3bb7c990445d /src | |
parent | b1491eba40715438b0ac874f2be79d5622b971e1 (diff) |
journalctl: respect --after-cursor semantics with --follow in all cases
In the case where no entries have been added to the journal after the specified
cursor, set need_seek before the main loop to prevent display of the entry at
said cursor.
Diffstat (limited to 'src')
-rw-r--r-- | src/journal/journalctl.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 5c2a56d575..3cec9a0c84 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -1934,9 +1934,13 @@ int main(int argc, char *argv[]) { else r = sd_journal_previous_skip(j, 1 + !!arg_after_cursor); - if (arg_after_cursor && r < 2 && !arg_follow) + if (arg_after_cursor && r < 2) { /* We couldn't find the next entry after the cursor. */ - arg_lines = 0; + if (arg_follow) + need_seek = true; + else + arg_lines = 0; + } } else if (arg_since_set && !arg_reverse) { r = sd_journal_seek_realtime_usec(j, arg_since); |