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

Lines changed: 0 additions & 6 deletions
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

Lines changed: 2 additions & 5 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy