summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/scp.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2005-01-24 10:22:07 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2005-01-24 10:22:07 +0000
commite62cc3e6a439343ba8bb508c2309623e8615b20e (patch)
tree81c4a949b487f3ada181ad848dd8afb03eb87f5b /usr.bin/ssh/scp.c
parent625e5f755aa1c0cef661d58e876915901de4ad05 (diff)
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 'usr.bin/ssh/scp.c')
-rw-r--r--usr.bin/ssh/scp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/ssh/scp.c b/usr.bin/ssh/scp.c
index c7a46cdbf2b..a014442aae0 100644
--- a/usr.bin/ssh/scp.c
+++ b/usr.bin/ssh/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);
}