summaryrefslogtreecommitdiff
path: root/sftp.c
diff options
context:
space:
mode:
authordtucker <dtucker>2005-01-24 10:57:40 +0000
committerdtucker <dtucker>2005-01-24 10:57:40 +0000
commit7a228a7e6d3b350936f0e584cc871b8d03f6953d (patch)
tree40f704aedb27b77b5b61ebb2f900d94bd3e69feb /sftp.c
parent150f049af8c888474b56de8d7d3a386c246622a1 (diff)
downloadopenssh-7a228a7e6d3b350936f0e584cc871b8d03f6953d.tar.gz
- dtucker@cvs.openbsd.org 2005/01/24 10:22:06
[scp.c sftp.c] Have scp and sftp wait for the spawned ssh to exit before they exit themselves. This prevents ssh from being unable to restore terminal modes (not normally a problem on OpenBSD but common with -Portable on POSIX platforms). From peak at argo.troja.mff.cuni.cz (bz#950); ok djm@ markus@
Diffstat (limited to 'sftp.c')
-rw-r--r--sftp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sftp.c b/sftp.c
index 9e29cb02..31c63499 100644
--- a/sftp.c
+++ b/sftp.c
@@ -16,7 +16,7 @@
#include "includes.h"
-RCSID("$OpenBSD: sftp.c,v 1.60 2004/12/10 03:10:42 fgsch Exp $");
+RCSID("$OpenBSD: sftp.c,v 1.61 2005/01/24 10:22:06 dtucker Exp $");
#ifdef USE_LIBEDIT
#include <histedit.h>
@@ -150,8 +150,10 @@ int interactive_loop(int fd_in, int fd_out, char *file1, char *file2);
static void
killchild(int signo)
{
- if (sshpid > 1)
+ if (sshpid > 1) {
kill(sshpid, SIGTERM);
+ waitpid(sshpid, NULL, 0);
+ }
_exit(1);
}