summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@perex.cz>2013-03-22 13:21:25 +0100
committerJaroslav Kysela <perex@perex.cz>2013-03-22 14:00:44 +0100
commit6de3c709b34c263e93a326e0a025c419ff3dd0f7 (patch)
tree382d62cad360441e68c67bee82132775b66500c0
parent741064c601754b5cbf3bed14fdab6115dd3f9500 (diff)
downloadalsa-utils-6de3c709b34c263e93a326e0a025c419ff3dd0f7.tar.gz
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>
-rw-r--r--aplay/aplay.c4
1 files changed, 4 insertions, 0 deletions
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))