01_pg_veriify_checksum_debug_to_verbose.patch
text/x-diff
Filename: 01_pg_veriify_checksum_debug_to_verbose.patch
Type: text/x-diff
Part: 0
Patch
Format: unified
| File | + | − |
|---|---|---|
| src/bin/pg_verify_checksums/pg_verify_checksums.c | 7 | 6 |
commit 452f981c30c9d9c7263e6006dc4cda51278ff376
Author: Yugo Nagata <nagata@sraoss.co.jp>
Date: Wed Aug 29 19:37:13 2018 +0900
Raname pg_verity_checksums debug option -d to -v / verbose
diff --git a/src/bin/pg_verify_checksums/pg_verify_checksums.c b/src/bin/pg_verify_checksums/pg_verify_checksums.c
index 938b92282a..0f931b7579 100644
--- a/src/bin/pg_verify_checksums/pg_verify_checksums.c
+++ b/src/bin/pg_verify_checksums/pg_verify_checksums.c
@@ -31,7 +31,7 @@ static int64 badblocks = 0;
static ControlFileData *ControlFile;
static char *only_relfilenode = NULL;
-static bool debug = false;
+static bool verbose = false;
static const char *progname;
@@ -43,7 +43,7 @@ usage()
printf(_(" %s [OPTION]... [DATADIR]\n"), progname);
printf(_("\nOptions:\n"));
printf(_(" [-D, --pgdata=]DATADIR data directory\n"));
- printf(_(" -d debug output, list all checked blocks\n"));
+ printf(_(" -v, --verbose output verbose messages, list all checked blocks\n"));
printf(_(" -r RELFILENODE check only relation with specified relfilenode\n"));
printf(_(" -V, --version output version information, then exit\n"));
printf(_(" -?, --help show this help, then exit\n"));
@@ -120,7 +120,7 @@ scan_file(char *fn, int segmentno)
progname, fn, blockno, csum, header->pd_checksum);
badblocks++;
}
- else if (debug)
+ else if (verbose)
fprintf(stderr, _("%s: checksum verified in file \"%s\", block %d: %X\n"),
progname, fn, blockno, csum);
}
@@ -208,6 +208,7 @@ main(int argc, char *argv[])
{
static struct option long_options[] = {
{"pgdata", required_argument, NULL, 'D'},
+ {"verbose", no_argument, NULL, 'v'},
{NULL, 0, NULL, 0}
};
@@ -234,12 +235,12 @@ main(int argc, char *argv[])
}
}
- while ((c = getopt_long(argc, argv, "D:r:d", long_options, &option_index)) != -1)
+ while ((c = getopt_long(argc, argv, "D:r:v", long_options, &option_index)) != -1)
{
switch (c)
{
- case 'd':
- debug = true;
+ case 'v':
+ verbose = true;
break;
case 'D':
DataDir = optarg;