]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorAndreas Gustafsson <source@isc.org>
Wed, 21 Mar 2001 00:26:27 +0000 (00:26 +0000)
committerAndreas Gustafsson <source@isc.org>
Wed, 21 Mar 2001 00:26:27 +0000 (00:26 +0000)
 784.   [bug]           nsupdate and other programs would not quit properly
                        if some signals were blocked by the caller. [RT #1081]

CHANGES
lib/isc/unix/app.c

diff --git a/CHANGES b/CHANGES
index ebd5cd4d719693af4cfe7b6af20ebdd21ab253c6..76c6c3db88c804e1d9f651ff864e86be92e112bb 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
+
  785.  [bug]           A race condition in the resolver could cause
                        an assertion failure. [RT #673, #872, #1048]
 
+ 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
                        rare conditions.
index aa99ab84f42c5d1a2600d2ab9b8e751bdca29d31..40a82e16040aee1a954ee193d9e1eeb33e123f95 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: app.c,v 1.36.2.3 2001/03/14 06:32:15 bwelling Exp $ */
+/* $Id: app.c,v 1.36.2.4 2001/03/21 00:26:27 gson Exp $ */
 
 #include <config.h>
 
@@ -116,10 +116,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.
@@ -217,6 +215,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);