summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-03-07 21:49:12 +0100
committerLennart Poettering <lennart@poettering.net>2013-03-07 21:49:12 +0100
commitfe59e38bef69568c385d10761132458606cdd896 (patch)
treefba5969e43586f09aece79d2bc7b277620ce00ee
parent2e4015f3e73173a4346c03a1ed7962f7d3423ed2 (diff)
journalctl: imply -n1000 when -e is used
Make sure the pager does not have to buffer an unbounded number of log messages, by default.
-rw-r--r--man/journalctl.xml12
-rw-r--r--src/journal/journalctl.c4
2 files changed, 12 insertions, 4 deletions
diff --git a/man/journalctl.xml b/man/journalctl.xml
index 201f66a3b5..3db5e5dab6 100644
--- a/man/journalctl.xml
+++ b/man/journalctl.xml
@@ -168,10 +168,14 @@
<listitem><para>Immediately jump to
the end of the journal inside the
- implied pager tool. Very useful in
- combination with the
- <option>-b</option> option. Note that
- this is only supported for the
+ implied pager tool. This implies
+ <option>-n1000</option> to guarantee
+ that the pager won't buffer logs of
+ unbounded size. This may be overriden
+ with an explicit <option>-n</option>
+ with some other numeric value on the
+ command line. Note that this option is
+ only supported for the
<citerefentry><refentrytitle>less</refentrytitle><manvolnum>1</manvolnum></citerefentry>
pager.</para></listitem>
</varlistentry>
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index 5fb2db3ba5..3682329e46 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -221,6 +221,10 @@ static int parse_argv(int argc, char *argv[]) {
case 'e':
arg_pager_end = true;
+
+ if (arg_lines < 0)
+ arg_lines = 1000;
+
break;
case 'f':