diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-06-05 21:58:03 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-06 05:54:02 +0400 |
commit | c8a11014b673ebc6946db6fcd20009d330c57c48 (patch) | |
tree | 711c8a84b09da88805bfeb46f778e5c1a2a08299 /ffmpeg.c | |
parent | ad60b3b1811f6fce23baf8cf081f469244004aae (diff) |
ffmpeg: use isatty() before messing with the terminal state
This fixes terminal messup in case of crashes (like in make fate)
Reviewed-by: François Revol <revol@free.fr>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1217,7 +1217,9 @@ static void term_init(void) #if HAVE_TERMIOS_H if(!run_as_daemon){ struct termios tty; - +#if HAVE_ISATTY + if(isatty(0) && isatty(2)) +#endif if (tcgetattr (0, &tty) == 0) { oldtty = tty; restore_tty = 1; |