From 11bd8d9c3917fad2f78734d12c5a8805b9fa756d Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Mon, 19 Aug 2002 02:06:01 +0000 Subject: [PATCH] * subshell.c (synchronize): Discard all remaining data from stdin to the subshell. --- src/ChangeLog | 3 +++ src/subshell.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index bf69f6a7b..90a8ffe17 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2002-08-18 Pavel Roskin + * subshell.c (synchronize): Discard all remaining data from + stdin to the subshell. + * subshell.c (exit_subshell) [AIX_TCSH_CODE_BELOW_IS_IT_FIXED]: Remove. Nobody has fixed this code for years. diff --git a/src/subshell.c b/src/subshell.c index 673ee59ef..678f236e6 100644 --- a/src/subshell.c +++ b/src/subshell.c @@ -1042,6 +1042,10 @@ static void synchronize (void) /* Wait until the subshell has stopped */ while (subshell_alive && !subshell_stopped) sigsuspend (&old_mask); + + /* Discard all remaining data from stdin to the subshell */ + tcflush (subshell_pty, TCOFLUSH); + subshell_stopped = FALSE; kill (subshell_pid, SIGCONT);