summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/sftp.c
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2001-02-06 22:06:22 +0000
committerDamien Miller <djm@cvs.openbsd.org>2001-02-06 22:06:22 +0000
commitadb435d165db8b996b431aba9d4e3aaaa38c458e (patch)
treecd64245007423c5aa03e8a179d6473ec07b5329a /usr.bin/ssh/sftp.c
parentec2236c3a75184bef44bb9b1efb106bf2c6537e3 (diff)
Wait for ssh subprocess at exit
Diffstat (limited to 'usr.bin/ssh/sftp.c')
-rw-r--r--usr.bin/ssh/sftp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/ssh/sftp.c b/usr.bin/ssh/sftp.c
index bb51551a9d5..69f0ef8a1c1 100644
--- a/usr.bin/ssh/sftp.c
+++ b/usr.bin/ssh/sftp.c
@@ -24,7 +24,7 @@
#include "includes.h"
-RCSID("$OpenBSD: sftp.c,v 1.3 2001/02/06 22:05:25 djm Exp $");
+RCSID("$OpenBSD: sftp.c,v 1.4 2001/02/06 22:06:21 djm Exp $");
/* XXX: commandline mode */
/* XXX: copy between two remote hosts (commandline) */
@@ -225,7 +225,8 @@ main(int argc, char **argv)
if (kill(sshpid, SIGHUP) == -1)
fatal("Couldn't terminate ssh process: %s", strerror(errno));
- /* XXX: wait? */
+ if (waitpid(sshpid, NULL, 0) == -1)
+ fatal("Couldn't wait for ssh process: %s", strerror(errno));
exit(0);
}