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

Appearance settings

Commit add5fad

Browse filesBrowse files
committed
pg_amcheck: Use logging functions
This was already mostly done, but some error messages were printed the long way.
1 parent 9bd563a commit add5fad
Copy full SHA for add5fad

File tree

Expand file treeCollapse file tree

1 file changed

+7
-13
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-13
lines changed

‎src/bin/pg_amcheck/pg_amcheck.c

Copy file name to clipboardExpand all lines: src/bin/pg_amcheck/pg_amcheck.c
+7-13Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,7 @@ main(int argc, char *argv[])
319319
opts.jobs = atoi(optarg);
320320
if (opts.jobs < 1)
321321
{
322-
fprintf(stderr,
323-
_("number of parallel jobs must be at least 1\n"));
322+
pg_log_error("number of parallel jobs must be at least 1");
324323
exit(1);
325324
}
326325
break;
@@ -393,37 +392,33 @@ main(int argc, char *argv[])
393392
opts.skip = "all frozen";
394393
else
395394
{
396-
fprintf(stderr, _("invalid skip option\n"));
395+
pg_log_error("invalid skip option");
397396
exit(1);
398397
}
399398
break;
400399
case 7:
401400
opts.startblock = strtol(optarg, &endptr, 10);
402401
if (*endptr != '\0')
403402
{
404-
fprintf(stderr,
405-
_("invalid start block\n"));
403+
pg_log_error("invalid start block");
406404
exit(1);
407405
}
408406
if (opts.startblock > MaxBlockNumber || opts.startblock < 0)
409407
{
410-
fprintf(stderr,
411-
_("start block out of bounds\n"));
408+
pg_log_error("start block out of bounds");
412409
exit(1);
413410
}
414411
break;
415412
case 8:
416413
opts.endblock = strtol(optarg, &endptr, 10);
417414
if (*endptr != '\0')
418415
{
419-
fprintf(stderr,
420-
_("invalid end block\n"));
416+
pg_log_error("invalid end block");
421417
exit(1);
422418
}
423419
if (opts.endblock > MaxBlockNumber || opts.endblock < 0)
424420
{
425-
fprintf(stderr,
426-
_("end block out of bounds\n"));
421+
pg_log_error("end block out of bounds");
427422
exit(1);
428423
}
429424
break;
@@ -450,8 +445,7 @@ main(int argc, char *argv[])
450445

451446
if (opts.endblock >= 0 && opts.endblock < opts.startblock)
452447
{
453-
fprintf(stderr,
454-
_("end block precedes start block\n"));
448+
pg_log_error("end block precedes start block");
455449
exit(1);
456450
}
457451

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.