diff options
author | Darren Tucker <dtucker@zip.com.au> | 2005-01-24 21:57:40 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2005-01-24 21:57:40 +1100 |
commit | ba66df81a38c42c9e7419d1a564be9ae17b62268 (patch) | |
tree | 4979ebe30b72cf647f0e733364edda629e7dc900 /scp.c | |
parent | 660db78af227f26c6e1ee4ca795400cd7b8ac056 (diff) |
- 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.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -71,7 +71,7 @@ | |||
71 | */ | 71 | */ |
72 | 72 | ||
73 | #include "includes.h" | 73 | #include "includes.h" |
74 | RCSID("$OpenBSD: scp.c,v 1.118 2004/09/15 18:46:04 deraadt Exp $"); | 74 | RCSID("$OpenBSD: scp.c,v 1.119 2005/01/24 10:22:06 dtucker Exp $"); |
75 | 75 | ||
76 | #include "xmalloc.h" | 76 | #include "xmalloc.h" |
77 | #include "atomicio.h" | 77 | #include "atomicio.h" |
@@ -108,8 +108,10 @@ pid_t do_cmd_pid = -1; | |||
108 | static void | 108 | static void |
109 | killchild(int signo) | 109 | killchild(int signo) |
110 | { | 110 | { |
111 | if (do_cmd_pid > 1) | 111 | if (do_cmd_pid > 1) { |
112 | kill(do_cmd_pid, signo); | 112 | kill(do_cmd_pid, signo); |
113 | waitpid(do_cmd_pid, NULL, 0); | ||
114 | } | ||
113 | 115 | ||
114 | _exit(1); | 116 | _exit(1); |
115 | } | 117 | } |