Skip to content

Commit ee075fc

Browse files
committed
Fix reporting of missing or invalid command line arguments in pg_rewind.
pg_fatal never returns, so a multi-line message cannot be printed by calling it twice. Michael Paquier and Fujii Masao
1 parent 4e17e32 commit ee075fc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/bin/pg_rewind/pg_rewind.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,21 +157,21 @@ main(int argc, char **argv)
157157
/* No source given? Show usage */
158158
if (datadir_source == NULL && connstr_source == NULL)
159159
{
160-
pg_fatal("no source specified (--source-pgdata or --source-server)\n");
161-
pg_fatal("Try \"%s --help\" for more information.\n", progname);
160+
fprintf(stderr, _("no source specified (--source-pgdata or --source-server)\n"));
161+
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
162162
exit(1);
163163
}
164164

165165
if (datadir_target == NULL)
166166
{
167-
pg_fatal("no target data directory specified (--target-pgdata)\n");
167+
fprintf(stderr, _("no target data directory specified (--target-pgdata)\n"));
168168
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
169169
exit(1);
170170
}
171171

172172
if (argc != optind)
173173
{
174-
pg_fatal("%s: invalid arguments\n", progname);
174+
fprintf(stderr, _("invalid arguments\n"));
175175
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
176176
exit(1);
177177
}

0 commit comments

Comments
 (0)