scripts/mosh: Fix hang when remote closes the connection
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
committed by
John Hood
parent
9eeb2fbffa
commit
b58e750daf
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user