From 6de3c709b34c263e93a326e0a025c419ff3dd0f7 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 22 Mar 2013 13:21:25 +0100 Subject: [PATCH] aplay/arecord: added isatty() check (interactive mode) Turn off the interactive mode when stdin is not a tty. Signed-off-by: Jaroslav Kysela --- aplay/aplay.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aplay/aplay.c b/aplay/aplay.c index 4852b20..40d4f88 100644 --- a/aplay/aplay.c +++ b/aplay/aplay.c @@ -1394,6 +1394,10 @@ static void init_stdin(void) if (!interactive) return; + if (!isatty(fileno(stdin))) { + interactive = 0; + return; + } tcgetattr(fileno(stdin), &term); term_c_lflag = term.c_lflag; if (fd == fileno(stdin)) -- 2.47.1