diff options
author | ailin-nemui <ailin-nemui@users.noreply.github.com> | 2016-03-22 22:57:28 +0100 |
---|---|---|
committer | ailin-nemui <ailin-nemui@users.noreply.github.com> | 2016-03-22 22:57:28 +0100 |
commit | 29e160f0bf9e2c42c88c756b4fc61af29a7bfd59 (patch) | |
tree | 5666e05237ba1fc2109fb17606ca6f94a820825e /src/fe-text | |
parent | 3bc8afa740fdf775022c9fd3d92b2dfcb3c9804e (diff) | |
parent | 938d0071c6119f7ec9aeaa88913c47f7af267131 (diff) | |
download | irssi-29e160f0bf9e2c42c88c756b4fc61af29a7bfd59.zip |
Merge pull request #457 from ailin-nemui/fix_450
fix race condition in terminal init
Diffstat (limited to 'src/fe-text')
-rw-r--r-- | src/fe-text/terminfo-core.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/fe-text/terminfo-core.c b/src/fe-text/terminfo-core.c index 086c8801..aa833abf 100644 --- a/src/fe-text/terminfo-core.c +++ b/src/fe-text/terminfo-core.c @@ -504,7 +504,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); memcpy(&term->tio, &term->old_tio, sizeof(term->tio)); @@ -526,8 +526,11 @@ static void terminfo_input_init(TERM_REC *term) term->tio.c_cc[VSUSP] = _POSIX_VDISABLE; #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) @@ -687,6 +690,7 @@ static int term_setup(TERM_REC *term) term->beep = term->TI_bel ? _beep : _ignore; terminfo_setup_colors(term, FALSE); + terminfo_input_init0(term); terminfo_cont(term); return 1; } |