chiark / gitweb /
journalctl: imply -n1000 when -e is used
authorLennart Poettering <lennart@poettering.net>
Thu, 7 Mar 2013 20:49:12 +0000 (21:49 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 7 Mar 2013 20:49:12 +0000 (21:49 +0100)
Make sure the pager does not have to buffer an unbounded number of log
messages, by default.

man/journalctl.xml
src/journal/journalctl.c

index 201f66a3b5378e923c20be5df8186335fcbc42af..3db5e5dab6783716e0d740f47a50c93d6ee0704e 100644 (file)
 
                                 <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>
index 5fb2db3ba58aedeb866645dcc554cb612af55f12..3682329e4688f93ff416ad222ef5b69e2729836c 100644 (file)
@@ -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':