]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
turn binary mode on for raw/fast
authorMark Andrews <marka@isc.org>
Wed, 12 Sep 2012 05:26:50 +0000 (15:26 +1000)
committerMark Andrews <marka@isc.org>
Wed, 12 Sep 2012 05:30:50 +0000 (15:30 +1000)
bin/check/check-tool.c

index e936b7cc9dd2a57f0e8cbfd112e9d90cab77ce28..cb330f2f7db2e8b33c56db07f1e1278b511c2f1a 100644 (file)
@@ -640,6 +640,9 @@ dump_zone(const char *zonename, dns_zone_t *zone, const char *filename,
 {
        isc_result_t result;
        FILE *output = stdout;
+       const char *flags;
+
+       flags = (fileformat == dns_masterformat_text) ? "w+" : "wb+";
 
        if (debug) {
                if (filename != NULL && strcmp(filename, "-") != 0)
@@ -650,7 +653,7 @@ dump_zone(const char *zonename, dns_zone_t *zone, const char *filename,
        }
 
        if (filename != NULL && strcmp(filename, "-") != 0) {
-               result = isc_stdio_open(filename, "w+", &output);
+               result = isc_stdio_open(filename, flags, &output);
 
                if (result != ISC_R_SUCCESS) {
                        fprintf(stderr, "could not open output "