- 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@
diff --git a/scp.c b/scp.c
index 69b5fc6..f69fd05 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 @@
 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);
 }