]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3259. [bug] named-compilezone: Suppress "dump zone to <file>"
authorEvan Hunt <each@isc.org>
Thu, 22 Dec 2011 17:27:55 +0000 (17:27 +0000)
committerEvan Hunt <each@isc.org>
Thu, 22 Dec 2011 17:27:55 +0000 (17:27 +0000)
message when writing to stdout. [RT #27109]

CHANGES
bin/check/named-checkzone.c

diff --git a/CHANGES b/CHANGES
index c2624a4ee812129959afcc8cae6c4c811862feee..e14f8ccc89bbf7be91416a81091614bb668f0b13 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+3259.  [bug]           named-compilezone: Suppress "dump zone to <file>"
+                       message when writing to stdout. [RT #27109]
+
 3257.  [bug]           Do not generate a error message when calling fsync()
                        in a pipe or socket. [RT #27109]
 
index 178cbcdb19b7e7d3d8cf89ee7484ead67794e200..4d894984095d54b4f44e80c671b10750873d2513 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: named-checkzone.c,v 1.51.34.8 2011/08/30 23:45:12 tbox Exp $ */
+/* $Id: named-checkzone.c,v 1.51.34.9 2011/12/22 17:27:55 each Exp $ */
 
 /*! \file */
 
@@ -111,6 +111,7 @@ main(int argc, char **argv) {
        const char *outputformatstr = NULL;
        dns_masterformat_t inputformat = dns_masterformat_text;
        dns_masterformat_t outputformat = dns_masterformat_text;
+       isc_boolean_t logdump = ISC_FALSE;
        FILE *errout = stdout;
 
        outputstyle = &dns_master_style_full;
@@ -398,6 +399,7 @@ main(int argc, char **argv) {
 
        if (progmode == progmode_compile) {
                dumpzone = 1;   /* always dump */
+               logdump = !quiet;
                if (output_filename == NULL) {
                        fprintf(stderr,
                                "output file required, but not specified\n");
@@ -416,8 +418,10 @@ main(int argc, char **argv) {
            (output_filename == NULL ||
             strcmp(output_filename, "-") == 0 ||
             strcmp(output_filename, "/dev/fd/1") == 0 ||
-            strcmp(output_filename, "/dev/stdout") == 0))
+            strcmp(output_filename, "/dev/stdout") == 0)) {
                errout = stderr;
+               logdump = ISC_FALSE;
+       }
 
        if (isc_commandline_index + 2 != argc)
                usage();
@@ -442,13 +446,13 @@ main(int argc, char **argv) {
                           &zone);
 
        if (result == ISC_R_SUCCESS && dumpzone) {
-               if (!quiet && progmode == progmode_compile) {
+               if (logdump) {
                        fprintf(errout, "dump zone to %s...", output_filename);
                        fflush(errout);
                }
                result = dump_zone(origin, zone, output_filename,
                                   outputformat, outputstyle);
-               if (!quiet && progmode == progmode_compile)
+               if (logdump)
                        fprintf(errout, "done\n");
        }