aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorGravatar Anders Kaseorg <andersk@mit.edu>2014-01-29 05:00:31 -0500
committerGravatar John Hood <cgull@glup.org>2015-05-28 23:41:57 -0400
commitb58e750daf58c8d3c33c9713643e192fb815ab6c (patch)
treefe1560bf5c986cc93c4a06014089098cf5791211 /scripts
parent9eeb2fbffa9f63e2a2f1121009d3e1bba7839ec6 (diff)
scripts/mosh: Fix hang when remote closes the connection
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/mosh.pl3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/mosh.pl b/scripts/mosh.pl
index 41c31b0..7cf69e1 100755
--- a/scripts/mosh.pl
+++ b/scripts/mosh.pl
@@ -219,11 +219,14 @@ if ( defined $fake_proxy ) {
defined( my $pid = fork ) or die "$0: fork: $!\n";
if ( $pid == 0 ) {
+ close STDIN;
cat $sock, \*STDOUT; $sock->shutdown( 0 );
_exit 0;
}
$SIG{ 'HUP' } = 'IGNORE';
+ close STDOUT;
cat \*STDIN, $sock; $sock->shutdown( 1 );
+ close STDIN;
waitpid $pid, 0;
exit;
}