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:
@@ -81,19 +81,6 @@ static void t_sighandler();
|
||||
|
||||
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
|
||||
t_sighandler(int sig) {
|
||||
T_int = sig;
|
||||
@@ -221,12 +208,12 @@ main(int argc, char **argv)
|
||||
* people catch up to the latest unproven-pthread package.
|
||||
*/
|
||||
sa.sa_handler = SIG_DFL;
|
||||
(void)sigaction(SIGCHLD, &sa, NULL); /* Note: LOWERCASE sigaction */
|
||||
(void)sigaction(SIGCHLD, &sa, NULL);
|
||||
#endif
|
||||
|
||||
sa.sa_handler = t_sighandler;
|
||||
(void)SIGACTION(SIGINT, &sa, NULL);
|
||||
(void)SIGACTION(SIGALRM, &sa, NULL);
|
||||
(void)sigaction(SIGINT, &sa, NULL);
|
||||
(void)sigaction(SIGALRM, &sa, NULL);
|
||||
|
||||
/* output start stanza to journal */
|
||||
|
||||
@@ -260,7 +247,7 @@ main(int argc, char **argv)
|
||||
|
||||
T_int = 0;
|
||||
sa.sa_handler = t_sighandler;
|
||||
(void)SIGACTION(SIGALRM, &sa, NULL);
|
||||
(void)sigaction(SIGALRM, &sa, NULL);
|
||||
alarm(T_timeout);
|
||||
|
||||
deadpid = (pid_t) -1;
|
||||
@@ -286,7 +273,7 @@ main(int argc, char **argv)
|
||||
|
||||
alarm(0);
|
||||
sa.sa_handler = SIG_IGN;
|
||||
(void)SIGACTION(SIGALRM, &sa, NULL);
|
||||
(void)sigaction(SIGALRM, &sa, NULL);
|
||||
}
|
||||
else {
|
||||
t_info("fork failed, errno == %d\n", errno);
|
||||
|
Reference in New Issue
Block a user