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>
This commit is contained in:
parent
ad60b3b181
commit
c8a11014b6
1 changed files with 3 additions and 1 deletions
4
ffmpeg.c
4
ffmpeg.c
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue