summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/serverloop.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1999-10-03 21:02:12 +0000
committerderaadt <deraadt@openbsd.org>1999-10-03 21:02:12 +0000
commitc04147c553f3f5fd25dfc8b69c9d47fb103ca93c (patch)
tree0b944bac8e0ceff597d282b1ac5ce2267d536556 /usr.bin/ssh/serverloop.c
parenterrno trashing considered harmfull (diff)
downloadwireguard-openbsd-c04147c553f3f5fd25dfc8b69c9d47fb103ca93c.tar.xz
wireguard-openbsd-c04147c553f3f5fd25dfc8b69c9d47fb103ca93c.zip
errno trashing in signal handlers
Diffstat (limited to 'usr.bin/ssh/serverloop.c')
-rw-r--r--usr.bin/ssh/serverloop.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.bin/ssh/serverloop.c b/usr.bin/ssh/serverloop.c
index 063e0f42088..0545b04747d 100644
--- a/usr.bin/ssh/serverloop.c
+++ b/usr.bin/ssh/serverloop.c
@@ -49,6 +49,7 @@ static volatile int child_wait_status; /* Status from wait(). */
void sigchld_handler(int sig)
{
+ int save_errno = errno;
int wait_pid;
debug("Received SIGCHLD.");
wait_pid = wait((int *)&child_wait_status);
@@ -62,6 +63,7 @@ void sigchld_handler(int sig)
child_terminated = 1;
}
signal(SIGCHLD, sigchld_handler);
+ errno = save_errno;
}
/* Process any buffered packets that have been received from the client. */