Don't call redirect_tty_output when restoring the front process group

redirect_tty_output was a clumsy attempt to work around a glibc bug, but
it's not necessary if fish is about to exit.
This commit is contained in:
ridiculousfish 2020-05-31 13:51:47 -07:00
parent a2ae2d6c36
commit 03208acb60

View File

@ -2101,11 +2101,10 @@ void save_term_foreground_process_group() {
}
void restore_term_foreground_process_group() {
if (initial_fg_process_group == -1) return;
// This is called during shutdown and from a signal handler. We don't bother to complain on
// failure because doing so is unlikely to be noticed.
if (tcsetpgrp(STDIN_FILENO, initial_fg_process_group) == -1 && errno == ENOTTY) {
redirect_tty_output();
if (initial_fg_process_group != -1) {
// This is called during shutdown and from a signal handler. We don't bother to complain on
// failure because doing so is unlikely to be noticed.
(void)tcsetpgrp(STDIN_FILENO, initial_fg_process_group);
}
}