summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-07-07 03:30:31 +0200
committerLennart Poettering <lennart@poettering.net>2011-07-07 03:30:31 +0200
commit3b0727f5ec728206bf0db669088c9aa9ebb3c829 (patch)
treeb72cb0bc7b85443fb0c3e6fe8e9433ea3fdf3ebe /src
parentabca4822916b85ae5b0b2bef5d458ea2225d25ab (diff)
systemctl: cache tty value before we open the pager
Diffstat (limited to 'src')
-rw-r--r--src/systemctl.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/systemctl.c b/src/systemctl.c
index 556070bcba..6b4f981061 100644
--- a/src/systemctl.c
+++ b/src/systemctl.c
@@ -122,11 +122,6 @@ static pid_t agent_pid = 0;
static int daemon_reload(DBusConnection *bus, char **args, unsigned n);
-static void pager_open_if_enabled(void) {
- if (!arg_no_pager)
- pager_open();
-}
-
static bool on_tty(void) {
static int t = -1;
@@ -142,6 +137,13 @@ static bool on_tty(void) {
return t;
}
+static void pager_open_if_enabled(void) {
+ on_tty();
+
+ if (!arg_no_pager)
+ pager_open();
+}
+
static void spawn_ask_password_agent(void) {
pid_t parent;