summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/serverloop.c
diff options
context:
space:
mode:
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. */