1
0
mirror of https://github.com/irssi/irssi.git synced 2024-11-03 04:27:19 -05:00

Merge pull request #457 from ailin-nemui/fix_450

fix race condition in terminal init
This commit is contained in:
ailin-nemui 2016-03-22 22:57:28 +01:00
parent c657b9c3b1
commit 5ef2b958d9

View File

@ -496,7 +496,7 @@ void terminfo_setup_colors(TERM_REC *term, int force)
} }
} }
static void terminfo_input_init(TERM_REC *term) static void terminfo_input_init0(TERM_REC *term)
{ {
tcgetattr(fileno(term->in), &term->old_tio); tcgetattr(fileno(term->in), &term->old_tio);
memcpy(&term->tio, &term->old_tio, sizeof(term->tio)); memcpy(&term->tio, &term->old_tio, sizeof(term->tio));
@ -518,8 +518,11 @@ static void terminfo_input_init(TERM_REC *term)
term->tio.c_cc[VSUSP] = _POSIX_VDISABLE; term->tio.c_cc[VSUSP] = _POSIX_VDISABLE;
#endif #endif
tcsetattr(fileno(term->in), TCSADRAIN, &term->tio); }
static void terminfo_input_init(TERM_REC *term)
{
tcsetattr(fileno(term->in), TCSADRAIN, &term->tio);
} }
static void terminfo_input_deinit(TERM_REC *term) static void terminfo_input_deinit(TERM_REC *term)
@ -673,6 +676,7 @@ static int term_setup(TERM_REC *term)
term->beep = term->TI_bel ? _beep : _ignore; term->beep = term->TI_bel ? _beep : _ignore;
terminfo_setup_colors(term, FALSE); terminfo_setup_colors(term, FALSE);
terminfo_input_init0(term);
terminfo_cont(term); terminfo_cont(term);
return 1; return 1;
} }