Commit 48565891 authored by Brian Wellington's avatar Brian Wellington
Browse files

784. [bug] nsupdate and other programs would not quit properly

                        if some signals were blocked by the caller. [RT #1081]
parent be09eee2
784. [bug] nsupdate and other programs would not quit properly
if some signals were blocked by the caller. [RT #1081]
783. [bug] Following CNAMEs could cause an assertion failure
when either using an sdb database or under very
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: app.c,v 1.41 2001/03/19 22:44:52 bwelling Exp $ */
/* $Id: app.c,v 1.42 2001/03/20 21:45:20 bwelling Exp $ */
#include <config.h>
......@@ -117,10 +117,8 @@ handle_signal(int sig, void (*handler)(int)) {
isc_result_t
isc_app_start(void) {
isc_result_t result;
#ifdef ISC_PLATFORM_USETHREADS
int presult;
sigset_t sset;
#endif /* ISC_PLATFORM_USETHREADS */
/*
* Start an ISC library application.
......@@ -218,6 +216,30 @@ isc_app_start(void) {
strerror(presult));
return (ISC_R_UNEXPECTED);
}
#else /* ISC_PLATFORM_USETHREADS */
/*
* Unblock SIGHUP, SIGINT, SIGTERM.
*
* If we're not using threads, we need to make sure that SIGHUP,
* SIGINT and SIGTERM are not inherited as blocked from the parent
* process.
*/
if (sigemptyset(&sset) != 0 ||
sigaddset(&sset, SIGHUP) != 0 ||
sigaddset(&sset, SIGINT) != 0 ||
sigaddset(&sset, SIGTERM) != 0) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_app_start() sigsetops: %s",
strerror(errno));
return (ISC_R_UNEXPECTED);
}
presult = sigprocmask(SIG_UNBLOCK, &sset, NULL);
if (presult != 0) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_app_start() sigprocmask: %s",
strerror(presult));
return (ISC_R_UNEXPECTED);
}
#endif /* ISC_PLATFORM_USETHREADS */
ISC_LIST_INIT(on_run);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment