Commit 3a5cb1af by Stéphane Graber Committed by GitHub

Merge pull request #1424 from brauner/2017-02-08/thomasDOTjaroschATintra2netDOTcom_pty_sigttou

lxc_setup_tios(): Ignore SIGTTOU and SIGTTIN signals
parents b93fbd24 4dc96430
......@@ -257,6 +257,14 @@ int lxc_setup_tios(int fd, struct termios *oldtios)
return -1;
}
/* ensure we don't end up in an endless loop:
* The kernel might fire SIGTTOU while an
* ioctl() in tcsetattr() is executed. When the ioctl()
* is resumed and retries, the signal handler interrupts it again.
*/
signal (SIGTTIN, SIG_IGN);
signal (SIGTTOU, SIG_IGN);
newtios = *oldtios;
/* We use the same settings that ssh does. */
......@@ -265,7 +273,7 @@ int lxc_setup_tios(int fd, struct termios *oldtios)
#ifdef IUCLC
newtios.c_iflag &= ~IUCLC;
#endif
newtios.c_lflag &= ~(ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHONL);
newtios.c_lflag &= ~(TOSTOP | ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHONL);
#ifdef IEXTEN
newtios.c_lflag &= ~IEXTEN;
#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