summaryrefslogtreecommitdiff
path: root/src/journal/journalctl.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-02-25 15:29:59 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-02-25 15:29:59 -0500
commit06fb28b16eb4b6170c2e2c0cf1f673730309509b (patch)
tree785adf7225d02701b4b0418c61ef0c0c3a24848b /src/journal/journalctl.c
parent8984d7bb5cc1d34cae4ec31696974a9e9f0dca44 (diff)
parentea4b98e6577ad4311e4eb4d2384c82f0d870b5ba (diff)
Merge pull request #2671 from 0xAX/move-pager-open-to-one-place
tree-wide: merge pager_open_if_enabled() to the pager_open()
Diffstat (limited to 'src/journal/journalctl.c')
-rw-r--r--src/journal/journalctl.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index cab46d09ef..fd2cb99410 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -225,14 +225,6 @@ static int add_matches_for_device(sd_journal *j, const char *devpath) {
return 0;
}
-static void pager_open_if_enabled(void) {
-
- if (arg_no_pager)
- return;
-
- pager_open(arg_pager_end);
-}
-
static char *format_timestamp_maybe_utc(char *buf, size_t l, usec_t t) {
if (arg_utc)
@@ -278,7 +270,7 @@ static int parse_boot_descriptor(const char *x, sd_id128_t *boot_id, int *offset
static void help(void) {
- pager_open_if_enabled();
+ pager_open(arg_no_pager, arg_pager_end);
printf("%s [OPTIONS...] [MATCHES...]\n\n"
"Query the journal.\n\n"
@@ -1183,7 +1175,7 @@ static int list_boots(sd_journal *j) {
if (count == 0)
return count;
- pager_open_if_enabled();
+ pager_open(arg_no_pager, arg_pager_end);
/* numbers are one less, but we need an extra char for the sign */
w = DECIMAL_STR_WIDTH(count - 1) + 1;
@@ -2061,7 +2053,7 @@ int main(int argc, char *argv[]) {
} else {
bool oneline = arg_action == ACTION_LIST_CATALOG;
- pager_open_if_enabled();
+ pager_open(arg_no_pager, arg_pager_end);
if (optind < argc)
r = catalog_list_items(stdout, database, oneline, argv + optind);
@@ -2368,7 +2360,7 @@ int main(int argc, char *argv[]) {
}
if (!arg_follow)
- pager_open_if_enabled();
+ pager_open(arg_no_pager, arg_pager_end);
if (!arg_quiet) {
usec_t start, end;