another attempt to workaround a glibc bug

This is another attempt to fix issue #3644 that we believe is due to issue
https://sourceware.org/bugzilla/show_bug.cgi?id=20632.
This commit is contained in:
Kurtis Rader
2017-01-10 21:52:10 -08:00
parent 2e9a349dd0
commit 56e05dab02
3 changed files with 34 additions and 17 deletions

View File

@@ -820,7 +820,7 @@ static int terminal_return_from_job(job_t *j) {
// Save jobs terminal modes.
if (tcgetattr(STDIN_FILENO, &j->tmodes)) {
if (errno == ENOTTY) redirect_tty_output();
if (errno == EIO) redirect_tty_output();
debug(1, _(L"Could not return shell to foreground"));
wperror(L"tcgetattr");
return 0;
@@ -832,7 +832,8 @@ static int terminal_return_from_job(job_t *j) {
// https://github.com/fish-shell/fish-shell/issues/121
#if 0
// Restore the shell's terminal modes.
if (tcsetattr(STDIN_FILENO, TCSADRAIN, &shell_modes)) {
if (tcsetattr(STDIN_FILENO, TCSADRAIN, &shell_modes) == -1) {
if (errno == EIO) redirect_tty_output();
debug(1, _(L"Could not return shell to foreground"));
wperror(L"tcsetattr");
return 0;