diff options
-rw-r--r-- | sftp.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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[] = { | |||
220 | static void | 220 | static void |
221 | killchild(int signo) | 221 | killchild(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); |