]> granicus.if.org Git - postgresql/commitdiff
pg_upgrade: Clean up some redundant code
authorPeter Eisentraut <peter@eisentraut.org>
Thu, 10 Oct 2019 08:51:11 +0000 (10:51 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Thu, 10 Oct 2019 08:51:11 +0000 (10:51 +0200)
No need to call exit() after pg_fatal().  Clean up a few stragglers
for consistency.

src/bin/pg_upgrade/option.c
src/bin/pg_upgrade/pg_upgrade.c

index 28ff4c48ed39532234883dbcbb7d7dee1eb9ce25..da9e1da78db1a4a7aaf9aaee1c6626e295a8de2f 100644 (file)
@@ -169,18 +169,12 @@ parseCommandLine(int argc, char *argv[])
                                 */
                        case 'p':
                                if ((old_cluster.port = atoi(optarg)) <= 0)
-                               {
                                        pg_fatal("invalid old port number\n");
-                                       exit(1);
-                               }
                                break;
 
                        case 'P':
                                if ((new_cluster.port = atoi(optarg)) <= 0)
-                               {
                                        pg_fatal("invalid new port number\n");
-                                       exit(1);
-                               }
                                break;
 
                        case 'r':
index 5e617e97c0f0bc659a5105d5dcb0a169a71c3227..5b82e0c79bdd006f23ee00e097bdb5b5695c1a04 100644 (file)
@@ -105,11 +105,8 @@ main(int argc, char **argv)
 
        /* Set mask based on PGDATA permissions */
        if (!GetDataDirectoryCreatePerm(new_cluster.pgdata))
-       {
-               pg_log(PG_FATAL, "could not read permissions of directory \"%s\": %s\n",
-                          new_cluster.pgdata, strerror(errno));
-               exit(1);
-       }
+               pg_fatal("could not read permissions of directory \"%s\": %s\n",
+                                new_cluster.pgdata, strerror(errno));
 
        umask(pg_mode_mask);