diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-06-05 19:58:03 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-07 00:55:26 +0200 |
commit | dc85ca0945c902695815fe9a32aeb383236a19b6 (patch) | |
tree | 3153f94bfc647fd7640e1f4c3ed719ab576eeb94 | |
parent | a53ca16ae95f30173d1ad6d085045de0f6db0672 (diff) | |
download | ffmpeg-dc85ca0945c902695815fe9a32aeb383236a19b6.tar.gz |
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>
(cherry picked from commit c8a11014b673ebc6946db6fcd20009d330c57c48)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | ffmpeg.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1456,7 +1456,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; |