ffmpeg: avoid a confusing and easy to break if().
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Wed, 6 Jun 2012 10:39:07 +0000 (12:39 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 6 Jun 2012 15:13:28 +0000 (17:13 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ffmpeg.c

index 914bc6a..3d6853f 100644 (file)
--- 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);