summaryrefslogtreecommitdiffstats
path: root/sftp.c
diff options
context:
space:
mode:
authorderaadt@openbsd.org <deraadt@openbsd.org>2024-06-27 01:14:14 +0200
committerDamien Miller <djm@mindrot.org>2024-06-28 00:34:49 +0200
commitb8793e2b0851f7d71b97554fa5260b23796d6277 (patch)
treee1ac8a1974c9dc7c60e622d84528bc099da61c96 /sftp.c
parentupstream: - uppercase start of sentence - correct sentence grammar (diff)
downloadopenssh-b8793e2b0851f7d71b97554fa5260b23796d6277.tar.xz
openssh-b8793e2b0851f7d71b97554fa5260b23796d6277.zip
upstream: save_errno wrappers inside two small signal handlers that
perform system calls, for systems with libc that do perform libc sigtramps. ok djm markus OpenBSD-Commit-ID: 7749b56419a7c9dcfe4c6c04811e429813346c62
Diffstat (limited to 'sftp.c')
-rw-r--r--sftp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sftp.c b/sftp.c
index c080fba5d..360c5004a 100644
--- a/sftp.c
+++ b/sftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp.c,v 1.238 2024/04/30 06:16:55 djm Exp $ */
+/* $OpenBSD: sftp.c,v 1.239 2024/06/26 23:14:14 deraadt Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
@@ -234,12 +234,14 @@ killchild(int signo)
static void
suspchild(int signo)
{
+ int save_errno = errno;
if (sshpid > 1) {
kill(sshpid, signo);
while (waitpid(sshpid, NULL, WUNTRACED) == -1 && errno == EINTR)
continue;
}
kill(getpid(), SIGSTOP);
+ errno = save_errno;
}
static void