From a7ee4e01838a2ae5e3adf2d159d2f8f824e17ed7 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Thu, 20 Mar 2008 10:57:55 -0400 Subject: [PATCH] debugfs: Don't use a pager if stdout is not a tty If we are redirecting the output of debugfs to a file or to another process via a pipe, there's no point sending the output to a pager. Signed-off-by: "Theodore Ts'o" --- debugfs/util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debugfs/util.c b/debugfs/util.c index a490d2c..0633960 100644 --- a/debugfs/util.c +++ b/debugfs/util.c @@ -82,6 +82,8 @@ FILE *open_pager(void) char buf[80]; signal(SIGPIPE, SIG_IGN); + if (!isatty(1)) + return stdout; if (!pager) pager = getenv("PAGER"); if (!pager) -- 1.8.3.1