mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-02 07:35:26 +00:00
784. [bug] nsupdate and other programs would not quit properly
if some signals were blocked by the caller. [RT #1081]
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -1,3 +1,5 @@
|
|||||||
|
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
|
783. [bug] Following CNAMEs could cause an assertion failure
|
||||||
when either using an sdb database or under very
|
when either using an sdb database or under very
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* 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>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -117,10 +117,8 @@ handle_signal(int sig, void (*handler)(int)) {
|
|||||||
isc_result_t
|
isc_result_t
|
||||||
isc_app_start(void) {
|
isc_app_start(void) {
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
#ifdef ISC_PLATFORM_USETHREADS
|
|
||||||
int presult;
|
int presult;
|
||||||
sigset_t sset;
|
sigset_t sset;
|
||||||
#endif /* ISC_PLATFORM_USETHREADS */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Start an ISC library application.
|
* Start an ISC library application.
|
||||||
@@ -218,6 +216,30 @@ isc_app_start(void) {
|
|||||||
strerror(presult));
|
strerror(presult));
|
||||||
return (ISC_R_UNEXPECTED);
|
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 */
|
#endif /* ISC_PLATFORM_USETHREADS */
|
||||||
|
|
||||||
ISC_LIST_INIT(on_run);
|
ISC_LIST_INIT(on_run);
|
||||||
|
Reference in New Issue
Block a user