Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 3b5d372

Browse files
committed
pg_upgrade: Clean up some redundant code
No need to call exit() after pg_fatal(). Clean up a few stragglers for consistency.
1 parent 93765bd commit 3b5d372

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

src/bin/pg_upgrade/option.c

-6
Original file line numberDiff line numberDiff line change
@@ -169,18 +169,12 @@ parseCommandLine(int argc, char *argv[])
169169
*/
170170
case 'p':
171171
if ((old_cluster.port = atoi(optarg)) <= 0)
172-
{
173172
pg_fatal("invalid old port number\n");
174-
exit(1);
175-
}
176173
break;
177174

178175
case 'P':
179176
if ((new_cluster.port = atoi(optarg)) <= 0)
180-
{
181177
pg_fatal("invalid new port number\n");
182-
exit(1);
183-
}
184178
break;
185179

186180
case 'r':

src/bin/pg_upgrade/pg_upgrade.c

+2-5
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,8 @@ main(int argc, char **argv)
105105

106106
/* Set mask based on PGDATA permissions */
107107
if (!GetDataDirectoryCreatePerm(new_cluster.pgdata))
108-
{
109-
pg_log(PG_FATAL, "could not read permissions of directory \"%s\": %s\n",
110-
new_cluster.pgdata, strerror(errno));
111-
exit(1);
112-
}
108+
pg_fatal("could not read permissions of directory \"%s\": %s\n",
109+
new_cluster.pgdata, strerror(errno));
113110

114111
umask(pg_mode_mask);
115112

0 commit comments

Comments
 (0)