openssh/SOURCES/openssh-8.0p1-avoidkillall.patch

21 lines
377 B
Diff

diff --git a/sftp.c b/sftp.c
index b66037f1..54538ff9 100644
--- a/sftp.c
+++ b/sftp.c
@@ -220,9 +220,12 @@ static const struct CMD cmds[] = {
static void
killchild(int signo)
{
- if (sshpid > 1) {
- kill(sshpid, SIGTERM);
- waitpid(sshpid, NULL, 0);
+ pid_t pid;
+
+ pid = sshpid;
+ if (pid > 1) {
+ kill(pid, SIGTERM);
+ (void)waitpid(pid, NULL, 0);
}
_exit(1);