Commit 2224df52 authored by mru's avatar mru

Register atexit handler only when needed

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@22599 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 3e6e966d
...@@ -318,14 +318,12 @@ typedef struct AVInputFile { ...@@ -318,14 +318,12 @@ typedef struct AVInputFile {
/* init terminal so that we can grab keys */ /* init terminal so that we can grab keys */
static struct termios oldtty; static struct termios oldtty;
#endif
static void term_exit(void) static void term_exit(void)
{ {
#if HAVE_TERMIOS_H
tcsetattr (0, TCSANOW, &oldtty); tcsetattr (0, TCSANOW, &oldtty);
#endif
} }
#endif
static volatile int received_sigterm = 0; static volatile int received_sigterm = 0;
...@@ -343,6 +341,7 @@ static void term_init(void) ...@@ -343,6 +341,7 @@ static void term_init(void)
tcgetattr (0, &tty); tcgetattr (0, &tty);
oldtty = tty; oldtty = tty;
atexit(term_exit);
tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP
|INLCR|IGNCR|ICRNL|IXON); |INLCR|IGNCR|ICRNL|IXON);
...@@ -363,10 +362,6 @@ static void term_init(void) ...@@ -363,10 +362,6 @@ static void term_init(void)
signal(SIGXCPU, sigterm_handler); signal(SIGXCPU, sigterm_handler);
#endif #endif
/*
register a function to be called at normal program termination
*/
atexit(term_exit);
#if CONFIG_BEOS_NETSERVER #if CONFIG_BEOS_NETSERVER
fcntl(0, F_SETFL, fcntl(0, F_GETFL) | O_NONBLOCK); fcntl(0, F_SETFL, fcntl(0, F_GETFL) | O_NONBLOCK);
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment