summaryrefslogtreecommitdiff
path: root/src/bin/pg_upgrade
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2016-08-15 13:49:49 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2016-08-15 13:49:49 -0400
commitca9112a424ff68ec4f2ef67b47122f7d61412964 (patch)
treeda13d4eead313a32e53849ea0b7dd1de9a00fb29 /src/bin/pg_upgrade
parentb5bce6c1ec6061c8a4f730d927e162db7e2ce365 (diff)
Stamp HEAD as 10devel.
This is a good bit more complicated than the average new-version stamping commit, because it includes various adjustments in pursuit of changing from three-part to two-part version numbers. It's likely some further work will be needed around that change; but this is enough to get through the regression tests, at least in Unix builds. Peter Eisentraut and Tom Lane
Diffstat (limited to 'src/bin/pg_upgrade')
-rw-r--r--src/bin/pg_upgrade/check.c6
-rw-r--r--src/bin/pg_upgrade/server.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/bin/pg_upgrade/check.c b/src/bin/pg_upgrade/check.c
index f901e3c5125..ed41dee6a54 100644
--- a/src/bin/pg_upgrade/check.c
+++ b/src/bin/pg_upgrade/check.c
@@ -1082,8 +1082,8 @@ get_bin_version(ClusterInfo *cluster)
char cmd[MAXPGPATH],
cmd_output[MAX_STRING];
FILE *output;
- int pre_dot,
- post_dot;
+ int pre_dot = 0,
+ post_dot = 0;
snprintf(cmd, sizeof(cmd), "\"%s/pg_ctl\" --version", cluster->bindir);
@@ -1098,7 +1098,7 @@ get_bin_version(ClusterInfo *cluster)
if (strchr(cmd_output, '\n') != NULL)
*strchr(cmd_output, '\n') = '\0';
- if (sscanf(cmd_output, "%*s %*s %d.%d", &pre_dot, &post_dot) != 2)
+ if (sscanf(cmd_output, "%*s %*s %d.%d", &pre_dot, &post_dot) < 1)
pg_fatal("could not get version from %s\n", cmd);
cluster->bin_version = (pre_dot * 100 + post_dot) * 100;
diff --git a/src/bin/pg_upgrade/server.c b/src/bin/pg_upgrade/server.c
index 830335f5019..12432bb1d07 100644
--- a/src/bin/pg_upgrade/server.c
+++ b/src/bin/pg_upgrade/server.c
@@ -166,7 +166,7 @@ get_major_server_version(ClusterInfo *cluster)
if (fscanf(version_fd, "%63s", cluster->major_version_str) == 0 ||
sscanf(cluster->major_version_str, "%d.%d", &integer_version,
- &fractional_version) != 2)
+ &fractional_version) < 1)
pg_fatal("could not get version from %s\n", cluster->pgdata);
fclose(version_fd);