tui/suspend_event(): set STDIN to "blocking"

Set STDIN to blocking on "suspend". This was missed in #2598.
See 8a782f1699.

Also on "continue"/SIGCONT explicitly set STDIN back to NON-blocking.
We don't explicitly do that on *startup* (libuv does it internally),
but on "continue" it seems wise to restore libuv's expectations.

Closes #5459
This commit is contained in:
Justin M. Keyes 2016-11-02 01:20:16 +01:00
parent d37c2e5dc2
commit 36c0ec6dd4

View File

@ -611,6 +611,7 @@ static void suspend_event(void **argv)
bool enable_mouse = data->mouse_enabled;
tui_terminal_stop(ui);
data->cont_received = false;
stream_set_blocking(input_global_fd(), true); // normalize stream (#2598)
kill(0, SIGTSTP);
while (!data->cont_received) {
// poll the event loop until SIGCONT is received
@ -620,6 +621,7 @@ static void suspend_event(void **argv)
if (enable_mouse) {
tui_mouse_on(ui);
}
stream_set_blocking(input_global_fd(), false); // libuv expects this
// resume the main thread
CONTINUE(data->bridge);
}