From: Michael Paquier Date: Sat, 23 Mar 2019 12:56:43 +0000 (+0900) Subject: Improve format of code and some error messages in pg_checksums X-Git-Tag: REL_12_BETA1~451 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=4ba96d1b82d694fead0ac709f9429cbb7ea89cb0;p=postgresql.git Improve format of code and some error messages in pg_checksums This makes the code more consistent with the surroundings. Author: Fabrízio de Royes Mello Discussion: https://postgr.es/m/CAFcNs+pXb_35r5feMU3-dWsWxXU=Yjq+spUsthFyGFbT0QcaKg@mail.gmail.com --- diff --git a/src/bin/pg_checksums/pg_checksums.c b/src/bin/pg_checksums/pg_checksums.c index f9ab27c77c6..5c185ebed84 100644 --- a/src/bin/pg_checksums/pg_checksums.c +++ b/src/bin/pg_checksums/pg_checksums.c @@ -435,16 +435,18 @@ main(int argc, char *argv[]) fprintf(stderr, _("%s: data checksums are not enabled in cluster\n"), progname); exit(1); } + if (ControlFile->data_checksum_version == 0 && mode == PG_MODE_DISABLE) { - fprintf(stderr, _("%s: data checksums are already disabled in cluster.\n"), progname); + fprintf(stderr, _("%s: data checksums are already disabled in cluster\n"), progname); exit(1); } + if (ControlFile->data_checksum_version > 0 && mode == PG_MODE_ENABLE) { - fprintf(stderr, _("%s: data checksums are already enabled in cluster.\n"), progname); + fprintf(stderr, _("%s: data checksums are already enabled in cluster\n"), progname); exit(1); }