2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 14:07:59 +00:00

Use sigaction() on NetBSD now, too. Note this requires unproven-pthreads-0.13 or higher.

This commit is contained in:
Michael Graff 2000-04-07 23:39:24 +00:00
parent c2bb1a45d2
commit b7974ee772

View File

@ -81,19 +81,6 @@ static void t_sighandler();
static int T_int; static int T_int;
/*
* XXXMLG NetBSD's "default" pthreads implementation has a broken signal
* interface.
*
* Here, if using NetBSD, define SIGACTION() as pthread_sigaction(),
* otherwise make it sigaction().
*/
#if defined(__NetBSD__)
#define SIGACTION(a, b, c) pthread_sigaction((a), (b), (c))
#else
#define SIGACTION(a, b, c) sigaction((a), (b), (c))
#endif
static void static void
t_sighandler(int sig) { t_sighandler(int sig) {
T_int = sig; T_int = sig;
@ -221,12 +208,12 @@ main(int argc, char **argv)
* people catch up to the latest unproven-pthread package. * people catch up to the latest unproven-pthread package.
*/ */
sa.sa_handler = SIG_DFL; sa.sa_handler = SIG_DFL;
(void)sigaction(SIGCHLD, &sa, NULL); /* Note: LOWERCASE sigaction */ (void)sigaction(SIGCHLD, &sa, NULL);
#endif #endif
sa.sa_handler = t_sighandler; sa.sa_handler = t_sighandler;
(void)SIGACTION(SIGINT, &sa, NULL); (void)sigaction(SIGINT, &sa, NULL);
(void)SIGACTION(SIGALRM, &sa, NULL); (void)sigaction(SIGALRM, &sa, NULL);
/* output start stanza to journal */ /* output start stanza to journal */
@ -260,7 +247,7 @@ main(int argc, char **argv)
T_int = 0; T_int = 0;
sa.sa_handler = t_sighandler; sa.sa_handler = t_sighandler;
(void)SIGACTION(SIGALRM, &sa, NULL); (void)sigaction(SIGALRM, &sa, NULL);
alarm(T_timeout); alarm(T_timeout);
deadpid = (pid_t) -1; deadpid = (pid_t) -1;
@ -286,7 +273,7 @@ main(int argc, char **argv)
alarm(0); alarm(0);
sa.sa_handler = SIG_IGN; sa.sa_handler = SIG_IGN;
(void)SIGACTION(SIGALRM, &sa, NULL); (void)sigaction(SIGALRM, &sa, NULL);
} }
else { else {
t_info("fork failed, errno == %d\n", errno); t_info("fork failed, errno == %d\n", errno);