Commit add5fad7 authored by Peter Eisentraut's avatar Peter Eisentraut

pg_amcheck: Use logging functions

This was already mostly done, but some error messages were printed the
long way.
parent 9bd563aa
...@@ -319,8 +319,7 @@ main(int argc, char *argv[]) ...@@ -319,8 +319,7 @@ main(int argc, char *argv[])
opts.jobs = atoi(optarg); opts.jobs = atoi(optarg);
if (opts.jobs < 1) if (opts.jobs < 1)
{ {
fprintf(stderr, pg_log_error("number of parallel jobs must be at least 1");
_("number of parallel jobs must be at least 1\n"));
exit(1); exit(1);
} }
break; break;
...@@ -393,7 +392,7 @@ main(int argc, char *argv[]) ...@@ -393,7 +392,7 @@ main(int argc, char *argv[])
opts.skip = "all frozen"; opts.skip = "all frozen";
else else
{ {
fprintf(stderr, _("invalid skip option\n")); pg_log_error("invalid skip option");
exit(1); exit(1);
} }
break; break;
...@@ -401,14 +400,12 @@ main(int argc, char *argv[]) ...@@ -401,14 +400,12 @@ main(int argc, char *argv[])
opts.startblock = strtol(optarg, &endptr, 10); opts.startblock = strtol(optarg, &endptr, 10);
if (*endptr != '\0') if (*endptr != '\0')
{ {
fprintf(stderr, pg_log_error("invalid start block");
_("invalid start block\n"));
exit(1); exit(1);
} }
if (opts.startblock > MaxBlockNumber || opts.startblock < 0) if (opts.startblock > MaxBlockNumber || opts.startblock < 0)
{ {
fprintf(stderr, pg_log_error("start block out of bounds");
_("start block out of bounds\n"));
exit(1); exit(1);
} }
break; break;
...@@ -416,14 +413,12 @@ main(int argc, char *argv[]) ...@@ -416,14 +413,12 @@ main(int argc, char *argv[])
opts.endblock = strtol(optarg, &endptr, 10); opts.endblock = strtol(optarg, &endptr, 10);
if (*endptr != '\0') if (*endptr != '\0')
{ {
fprintf(stderr, pg_log_error("invalid end block");
_("invalid end block\n"));
exit(1); exit(1);
} }
if (opts.endblock > MaxBlockNumber || opts.endblock < 0) if (opts.endblock > MaxBlockNumber || opts.endblock < 0)
{ {
fprintf(stderr, pg_log_error("end block out of bounds");
_("end block out of bounds\n"));
exit(1); exit(1);
} }
break; break;
...@@ -450,8 +445,7 @@ main(int argc, char *argv[]) ...@@ -450,8 +445,7 @@ main(int argc, char *argv[])
if (opts.endblock >= 0 && opts.endblock < opts.startblock) if (opts.endblock >= 0 && opts.endblock < opts.startblock)
{ {
fprintf(stderr, pg_log_error("end block precedes start block");
_("end block precedes start block\n"));
exit(1); exit(1);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment