From 15218d6ed062ec24c4a7ec10d22d1113b4c79556 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Thu, 22 Dec 2011 17:29:22 +0000 Subject: [PATCH] 3259. [bug] named-compilezone: Suppress "dump zone to " message when writing to stdout. [RT #27109] --- CHANGES | 3 +++ bin/check/named-checkzone.c | 12 ++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index ac602d72d0..ff5c48d20d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +3259. [bug] named-compilezone: Suppress "dump zone to " + message when writing to stdout. [RT #27109] + 3258. [test] Add "forcing full sign with unreadable keys" test. [RT #27153] diff --git a/bin/check/named-checkzone.c b/bin/check/named-checkzone.c index c5ababdd47..8e1ae0179e 100644 --- a/bin/check/named-checkzone.c +++ b/bin/check/named-checkzone.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: named-checkzone.c,v 1.64 2011/12/22 07:32:39 each Exp $ */ +/* $Id: named-checkzone.c,v 1.65 2011/12/22 17:29:22 each Exp $ */ /*! \file */ @@ -116,6 +116,7 @@ main(int argc, char **argv) { dns_masterrawheader_t header; isc_uint32_t rawversion = 1, serialnum = 0; isc_boolean_t snset = ISC_FALSE; + isc_boolean_t logdump = ISC_FALSE; FILE *errout = stdout; char *endp; @@ -449,6 +450,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"); @@ -467,8 +469,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(); @@ -500,13 +504,13 @@ main(int argc, char **argv) { } 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, rawversion); - if (!quiet && progmode == progmode_compile) + if (logdump) fprintf(errout, "done\n"); }