]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1636. [bug] The dump done callback could get ISC_R_SUCCESS even if
authorMark Andrews <marka@isc.org>
Fri, 14 May 2004 00:55:57 +0000 (00:55 +0000)
committerMark Andrews <marka@isc.org>
Fri, 14 May 2004 00:55:57 +0000 (00:55 +0000)
                        a error had occured.  The database version no longer
                        matched the version of the database that was dumped.

CHANGES
lib/dns/masterdump.c

diff --git a/CHANGES b/CHANGES
index 4a3ff5fde568df1609b6edd4850dd83edc1bcf48..0cf4d7baade82cab6145be264326446ded0f658b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+1636.  [bug]           The dump done callback could get ISC_R_SUCCESS even if
+                       a error had occured.  The database version no longer
+                       matched the version of the database that was dumped.
+
 1635.  [bug]           Memory leak on error in query_addds().
 
 1634.  [placeholder]   rt11208
index 532d4e810d29060d871c98f0320f21a9a9319c8b..3b2ce7ec6e8154f801ef8a9e7f110b111e153c34 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: masterdump.c,v 1.73 2004/03/05 05:09:21 marka Exp $ */
+/* $Id: masterdump.c,v 1.74 2004/05/14 00:55:57 marka Exp $ */
 
 #include <config.h>
 
@@ -979,6 +979,7 @@ closeandrename(FILE *f, isc_result_t result, const char *temp, const char *file)
 static void
 dump_quantum(isc_task_t *task, isc_event_t *event) {
        isc_result_t result;
+       isc_result_t tresult;
        dns_dumpctx_t *dctx;
 
        REQUIRE(event != NULL);
@@ -994,11 +995,12 @@ dump_quantum(isc_task_t *task, isc_event_t *event) {
                return;
        }
 
-       if (dctx->file != NULL)
-               result = closeandrename(dctx->f, result,
-                                       dctx->tmpfile, dctx->file);
-       if (dctx->version != NULL)
-               dns_db_closeversion(dctx->db, &dctx->version, ISC_FALSE);
+       if (dctx->file != NULL) {
+               tresult = closeandrename(dctx->f, result,
+                                        dctx->tmpfile, dctx->file);
+               if (tresult != ISC_R_SUCCESS && result == ISC_R_SUCCESS)
+                       result = tresult;
+       }
        (dctx->done)(dctx->done_arg, result);
        isc_event_free(&event);
        dns_dumpctx_detach(&dctx);