summaryrefslogtreecommitdiff
path: root/sftp.c
diff options
context:
space:
mode:
Diffstat (limited to 'sftp.c')
-rw-r--r--sftp.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sftp.c b/sftp.c
index b66037f16..54538ff96 100644
--- a/sftp.c
+++ b/sftp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sftp.c,v 1.195 2019/10/02 00:42:30 djm Exp $ */ 1/* $OpenBSD: sftp.c,v 1.196 2019/11/01 03:54:33 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> 3 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
4 * 4 *
@@ -220,9 +220,12 @@ static const struct CMD cmds[] = {
220static void 220static void
221killchild(int signo) 221killchild(int signo)
222{ 222{
223 if (sshpid > 1) { 223 pid_t pid;
224 kill(sshpid, SIGTERM); 224
225 waitpid(sshpid, NULL, 0); 225 pid = sshpid;
226 if (pid > 1) {
227 kill(pid, SIGTERM);
228 waitpid(pid, NULL, 0);
226 } 229 }
227 230
228 _exit(1); 231 _exit(1);