aplay/arecord: added isatty() check (interactive mode)

Turn off the interactive mode when stdin is not a tty.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2013-03-22 13:21:25 +01:00
parent 741064c601
commit 6de3c709b3

View file

@ -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))