From 93147daf59b096f3d6ad6d9e8d8c11c293e425d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= Date: Wed, 6 Jun 2012 12:39:07 +0200 Subject: ffmpeg: avoid a confusing and easy to break if(). Signed-off-by: Michael Niedermayer --- ffmpeg.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ffmpeg.c') diff --git a/ffmpeg.c b/ffmpeg.c index 914bc6adb4..3d6853fb62 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -1217,10 +1217,11 @@ static void term_init(void) #if HAVE_TERMIOS_H if(!run_as_daemon){ struct termios tty; + int istty = 1; #if HAVE_ISATTY - if(isatty(0) && isatty(2)) + istty = isatty(0) && isatty(2); #endif - if (tcgetattr (0, &tty) == 0) { + if (istty && tcgetattr (0, &tty) == 0) { oldtty = tty; restore_tty = 1; atexit(term_exit); -- cgit v1.2.3