From 03208acb6011e96cc71186827e99cc9a9a4f80b0 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sun, 31 May 2020 13:51:47 -0700 Subject: [PATCH] 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. --- src/common.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/common.cpp b/src/common.cpp index 8f74174ea..f3c656936 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -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); } }