]> granicus.if.org Git - postgresql/commitdiff
pg_upgrade: simplify code layout in a few places
authorBruce Momjian <bruce@momjian.us>
Fri, 5 Jan 2018 19:11:15 +0000 (14:11 -0500)
committerBruce Momjian <bruce@momjian.us>
Fri, 5 Jan 2018 19:11:15 +0000 (14:11 -0500)
Backpatch-through: 9.4 (9.3 didn't need improving)

src/bin/pg_upgrade/exec.c
src/bin/pg_upgrade/server.c

index 1fa56b8c61fca559e56901286312bd139b97143d..ea454342221720aa13965509b9e0d540b3154ad7 100644 (file)
@@ -112,7 +112,6 @@ exec_prog(const char *log_file, const char *opt_log_file,
        pg_log(PG_VERBOSE, "%s\n", cmd);
 
 #ifdef WIN32
-
        /*
         * For some reason, Windows issues a file-in-use error if we write data to
         * the log file from a non-primary thread just before we create a
@@ -194,7 +193,6 @@ exec_prog(const char *log_file, const char *opt_log_file,
        }
 
 #ifndef WIN32
-
        /*
         * We can't do this on Windows because it will keep the "pg_ctl start"
         * output filename open until the server stops, so we do the \n\n above on
index 96181237f8d2436ba9cf279c2c83e0199c97f090..1b399a9841e03676edfbe5f11ef73497e983fdb1 100644 (file)
@@ -310,12 +310,8 @@ start_postmaster(ClusterInfo *cluster, bool throw_error)
         * running.
         */
        if (!pg_ctl_return)
-       {
-               if (cluster == &old_cluster)
-                       pg_fatal("pg_ctl failed to start the source server, or connection failed\n");
-               else
-                       pg_fatal("pg_ctl failed to start the target server, or connection failed\n");
-       }
+               pg_fatal("pg_ctl failed to start the %s server, or connection failed\n",
+                       cluster == &old_cluster ? "source" : "target");
 
        return true;
 }