From 33efe1270f238c818743e1863685dde684c43c72 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 22 Jan 2002 03:37:55 +0000 Subject: [PATCH] Use sigaction() not signal() --- auth/bsdauth.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/auth/bsdauth.c b/auth/bsdauth.c index 232bb7ed7..344176045 100644 --- a/auth/bsdauth.c +++ b/auth/bsdauth.c @@ -57,6 +57,7 @@ #endif /* HAVE_UNISTD_H */ #include #include +#include #include #include @@ -114,12 +115,15 @@ bsdauth_verify(pw, prompt, auth) char *s, *pass; size_t len; int authok = 0; - sig_t childkiller; + sigaction_t sa, osa; auth_session_t *as = (auth_session_t *) auth->data; extern int nil_pw; /* save old signal handler */ - childkiller = signal(SIGCHLD, SIG_DFL); + sigemptyset(&sa.sa_mask); + sa.sa_flags = SA_RESTART; + sa.sa_handler = SIG_DFL; + (void) sigaction(SIGCHLD, &sa, &osa); /* * If there is a challenge then print that instead of the normal @@ -160,7 +164,7 @@ bsdauth_verify(pw, prompt, auth) } /* restore old signal handler */ - (void)signal(SIGCHLD, childkiller); + (void) sigaction(SIGCHLD, &osa, NULL); if (authok) return(AUTH_SUCCESS); -- 2.40.0