X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flogin%2Floginctl.c;h=24941fef34c0945b4ef1e777ee5435286ff9bcdd;hb=8481248b9fbddc6d5e6ff26eb23505ef13dc85f7;hp=0d9358d279cb395b1645bc9637beecf532a69727;hpb=6d0274f11547a0f11200bb82bf598a5a253e12cf;p=elogind.git diff --git a/src/login/loginctl.c b/src/login/loginctl.c index 0d9358d27..24941fef3 100644 --- a/src/login/loginctl.c +++ b/src/login/loginctl.c @@ -50,26 +50,9 @@ static enum transport { static bool arg_ask_password = true; static const char *arg_host = NULL; -static bool on_tty(void) { - static int t = -1; - - /* Note that this is invoked relatively early, before we start - * the pager. That means the value we return reflects whether - * we originally were started on a tty, not if we currently - * are. But this is intended, since we want colour and so on - * when run in our own pager. */ - - if (_unlikely_(t < 0)) - t = isatty(STDOUT_FILENO) > 0; - - return t; -} - static void pager_open_if_enabled(void) { /* Cache result before we open the pager */ - on_tty(); - if (arg_no_pager) return; @@ -979,8 +962,7 @@ static int show(DBusConnection *bus, char **args, unsigned n) { show_properties = !strstr(args[0], "status"); - if (show_properties) - pager_open_if_enabled(); + pager_open_if_enabled(); if (show_properties && n <= 1) { /* If not argument is specified inspect the manager