From: Kern Sibbald Date: Tue, 14 Jan 2003 10:32:22 +0000 (+0000) Subject: Tweak dbcheck X-Git-Tag: Release-1.29~33 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cd60834aa38a0827076b23a1683608bfb58b3769;p=bacula%2Fbacula Tweak dbcheck git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@287 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/tools/dbcheck.c b/bacula/src/tools/dbcheck.c index b1397bc109..0d6df331e9 100644 --- a/bacula/src/tools/dbcheck.c +++ b/bacula/src/tools/dbcheck.c @@ -487,7 +487,7 @@ static void eliminate_duplicate_paths() exit(1); } printf("Found %d duplicate Path records.\n", name_list.num_ids); - if (verbose && yes_no("Print them? (yes/no): ")) { + if (name_list.num_ids && verbose && yes_no("Print them? (yes/no): ")) { print_name_list(&name_list); } if (fix) { @@ -528,7 +528,7 @@ static void eliminate_orphaned_jobmedia_records() exit(1); } printf("Found %d orphaned JobMedia records.\n", id_list.num_ids); - if (verbose && yes_no("Print them? (yes/no): ")) { + if (id_list.num_ids && verbose && yes_no("Print them? (yes/no): ")) { int i; for (i=0; i < id_list.num_ids; i++) { sprintf(buf, @@ -558,7 +558,7 @@ static void eliminate_orphaned_file_records() exit(1); } printf("Found %d orphaned File records.\n", id_list.num_ids); - if (verbose && yes_no("Print them? (yes/no): ")) { + if (name_list.num_ids && verbose && yes_no("Print them? (yes/no): ")) { int i; for (i=0; i < id_list.num_ids; i++) { sprintf(buf, @@ -588,7 +588,7 @@ static void eliminate_orphaned_path_records() exit(1); } printf("Found %d orphaned Path records.\n", id_list.num_ids); - if (verbose && yes_no("Print them? (yes/no): ")) { + if (id_list.num_ids && verbose && yes_no("Print them? (yes/no): ")) { int i; for (i=0; i < id_list.num_ids; i++) { sprintf(buf, "SELECT Path FROM Path WHERE PathId=%u", id_list.Id[i]); @@ -615,7 +615,7 @@ static void eliminate_orphaned_filename_records() exit(1); } printf("Found %d orphaned Filename records.\n", id_list.num_ids); - if (verbose && yes_no("Print them? (yes/no): ")) { + if (id_list.num_ids && verbose && yes_no("Print them? (yes/no): ")) { int i; for (i=0; i < id_list.num_ids; i++) { sprintf(buf, "SELECT Name FROM Filename WHERE FilenameId=%u", id_list.Id[i]); @@ -641,7 +641,7 @@ static void eliminate_orphaned_fileset_records() exit(1); } printf("Found %d orphaned FileSet records.\n", id_list.num_ids); - if (verbose && yes_no("Print them? (yes/no): ")) { + if (id_list.num_ids && verbose && yes_no("Print them? (yes/no): ")) { int i; for (i=0; i < id_list.num_ids; i++) { sprintf(buf, "SELECT FileSetId,FileSet,MD5 FROM FileSet "