mirror of
https://github.com/isc-projects/bind9.git
synced 2026-02-26 03:11:56 -05:00
Use sigaction() on NetBSD now, too. Note this requires unproven-pthreads-0.13 or higher.
This commit is contained in:
parent
c2bb1a45d2
commit
b7974ee772
1 changed files with 5 additions and 18 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue