]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix a signal race condition with the following change.
authorMark Andrews <marka@isc.org>
Tue, 7 Feb 2006 21:53:36 +0000 (21:53 +0000)
committerMark Andrews <marka@isc.org>
Tue, 7 Feb 2006 21:53:36 +0000 (21:53 +0000)
1980.   [func]          dnssec-signzone: output the SOA record as the
                        first record in the signed zone. [RT #15758]

bin/dnssec/dnssec-signzone.c

index 767edd9e70943e52131c0b871b0aaa66dcff8b41..433f9046fc2f2af43f5048f3db844e496f721b48 100644 (file)
@@ -16,7 +16,7 @@
  * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dnssec-signzone.c,v 1.195 2006/02/03 23:51:39 marka Exp $ */
+/* $Id: dnssec-signzone.c,v 1.196 2006/02/07 21:53:36 marka Exp $ */
 
 /*! \file */
 
@@ -2103,10 +2103,6 @@ main(int argc, char *argv[]) {
                if (result != ISC_R_SUCCESS)
                        fatal("failed to create task: %s",
                              isc_result_totext(result));
-               result = isc_app_onrun(mctx, master, startworker, tasks[i]);
-               if (result != ISC_R_SUCCESS)
-                       fatal("failed to start task: %s",
-                             isc_result_totext(result));
        }
 
        RUNTIME_CHECK(isc_mutex_init(&namelock) == ISC_R_SUCCESS);
@@ -2115,9 +2111,23 @@ main(int argc, char *argv[]) {
 
        presign();
        signapex();
-       (void)isc_app_run();
-       if (!finished)
-               fatal("process aborted by user");
+       if (!finished) {
+               /*
+                * There is more work to do.  Spread it out over multiple
+                * processors if possible.
+                */
+               for (i = 0; i < (int)ntasks; i++) {
+                       result = isc_app_onrun(mctx, master, startworker,
+                                              tasks[i]);
+                       if (result != ISC_R_SUCCESS)
+                               fatal("failed to start task: %s",
+                                     isc_result_totext(result));
+               }
+               (void)isc_app_run();
+               if (!finished)
+                       fatal("process aborted by user");
+       } else
+               isc_task_detach(&master);
        shuttingdown = ISC_TRUE;
        for (i = 0; i < (int)ntasks; i++)
                isc_task_detach(&tasks[i]);