From 8481248b9fbddc6d5e6ff26eb23505ef13dc85f7 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 18 Oct 2012 23:59:41 +0200 Subject: util: unify usage of on_tty() in util.c --- src/login/loginctl.c | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'src/login/loginctl.c') diff --git a/src/login/loginctl.c b/src/login/loginctl.c index 97c6617d7d..24941fef34 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; -- cgit v1.2.3-54-g00ecf