summaryrefslogtreecommitdiff
path: root/scp.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 /scp.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 'scp.c')
-rw-r--r--scp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/scp.c b/scp.c
index 69b5fc6d..f69fd05f 100644
--- a/scp.c
+++ b/scp.c
@@ -71,7 +71,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: scp.c,v 1.118 2004/09/15 18:46:04 deraadt Exp $");
+RCSID("$OpenBSD: scp.c,v 1.119 2005/01/24 10:22:06 dtucker Exp $");
#include "xmalloc.h"
#include "atomicio.h"
@@ -108,8 +108,10 @@ pid_t do_cmd_pid = -1;
static void
killchild(int signo)
{
- if (do_cmd_pid > 1)
+ if (do_cmd_pid > 1) {
kill(do_cmd_pid, signo);
+ waitpid(do_cmd_pid, NULL, 0);
+ }
_exit(1);
}