Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaf99d44

Browse files
committed
pg_verifybackup: Move skip_checksums into verifier_context.
This is in preparation for adding a second source file to thisdirectory. It will need access to this value. Also, fewer globalvariables is usually a good thing.Amul Sul, reviewed by Sravan Kumar and revised a bit by me.Discussion:http://postgr.es/m/CAAJ_b95mcGjkfAf1qduOR97CokW8-_i-dWLm3v6x1w2-OW9M+A@mail.gmail.com
1 parent76dd015 commitaf99d44

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

‎src/bin/pg_verifybackup/pg_verifybackup.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ typedef struct verifier_context
113113
manifest_data*manifest;
114114
char*backup_directory;
115115
SimpleStringListignore_list;
116+
boolskip_checksums;
116117
boolexit_on_error;
117118
boolsaw_any_error;
118119
}verifier_context;
@@ -162,9 +163,8 @@ static void usage(void);
162163

163164
staticconstchar*progname;
164165

165-
/*options */
166+
/*is progress reporting enabled? */
166167
staticboolshow_progress= false;
167-
staticboolskip_checksums= false;
168168

169169
/* Progress indicators */
170170
staticuint64total_size=0;
@@ -266,7 +266,7 @@ main(int argc, char **argv)
266266
quiet= true;
267267
break;
268268
case's':
269-
skip_checksums= true;
269+
context.skip_checksums= true;
270270
break;
271271
case'w':
272272
wal_directory=pstrdup(optarg);
@@ -363,7 +363,7 @@ main(int argc, char **argv)
363363
* Now do the expensive work of verifying file checksums, unless we were
364364
* told to skip it.
365365
*/
366-
if (!skip_checksums)
366+
if (!context.skip_checksums)
367367
verify_backup_checksums(&context);
368368

369369
/*
@@ -739,7 +739,8 @@ verify_backup_file(verifier_context *context, char *relpath, char *fullpath)
739739
verify_control_file(fullpath,context->manifest->system_identifier);
740740

741741
/* Update statistics for progress report, if necessary */
742-
if (show_progress&& !skip_checksums&&should_verify_checksum(m))
742+
if (show_progress&& !context->skip_checksums&&
743+
should_verify_checksum(m))
743744
total_size+=m->size;
744745

745746
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp