mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-08 17:32:04 -04:00
Install default handler for SIGCHLD -- more after I fix NetBSD's pthread code
This commit is contained in:
parent
164f0b0cae
commit
c2bb1a45d2
1 changed files with 11 additions and 11 deletions
|
|
@ -31,10 +31,6 @@
|
|||
|
||||
#include "include/tests/t_api.h"
|
||||
|
||||
#if !defined(__NetBSD__)
|
||||
#define T_API_USES_TIMEOUTS 1
|
||||
#endif
|
||||
|
||||
static char *Usage = "\t-a : run all tests\n"
|
||||
"\t-b <dir> : chdir to dir before running tests"
|
||||
"\t-c <config_file> : use specified config file\n"
|
||||
|
|
@ -218,11 +214,19 @@ main(int argc, char **argv)
|
|||
|
||||
sa.sa_flags = 0;
|
||||
sigfillset(&sa.sa_mask);
|
||||
sa.sa_handler = t_sighandler;
|
||||
#if defined(T_API_USES_TIMEOUTS)
|
||||
(void)SIGACTION(SIGALRM, &sa, NULL);
|
||||
|
||||
#ifdef SIGCHLD
|
||||
/*
|
||||
* This is mostly here for NetBSD's pthread implementation, until
|
||||
* people catch up to the latest unproven-pthread package.
|
||||
*/
|
||||
sa.sa_handler = SIG_DFL;
|
||||
(void)sigaction(SIGCHLD, &sa, NULL); /* Note: LOWERCASE sigaction */
|
||||
#endif
|
||||
|
||||
sa.sa_handler = t_sighandler;
|
||||
(void)SIGACTION(SIGINT, &sa, NULL);
|
||||
(void)SIGACTION(SIGALRM, &sa, NULL);
|
||||
|
||||
/* output start stanza to journal */
|
||||
|
||||
|
|
@ -255,11 +259,9 @@ main(int argc, char **argv)
|
|||
else if (T_pid > 0) {
|
||||
|
||||
T_int = 0;
|
||||
#if defined(T_API_USES_TIMEOUTS)
|
||||
sa.sa_handler = t_sighandler;
|
||||
(void)SIGACTION(SIGALRM, &sa, NULL);
|
||||
alarm(T_timeout);
|
||||
#endif
|
||||
|
||||
deadpid = (pid_t) -1;
|
||||
while (deadpid != T_pid) {
|
||||
|
|
@ -282,11 +284,9 @@ main(int argc, char **argv)
|
|||
break;
|
||||
}
|
||||
|
||||
#if defined(T_API_USES_TIMEOUTS)
|
||||
alarm(0);
|
||||
sa.sa_handler = SIG_IGN;
|
||||
(void)SIGACTION(SIGALRM, &sa, NULL);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
t_info("fork failed, errno == %d\n", errno);
|
||||
|
|
|
|||
Loading…
Reference in a new issue