summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian2011-10-01 13:59:27 +0000
committerBruce Momjian2011-10-01 14:01:43 +0000
commit878b74e094a70e660e5ed365a2c4e1b41460515d (patch)
tree669a443d023034683d9f48208579b45f7b972e6a
parent0a5d5a49d9965aa092e75ce31a88fbf5f05c5009 (diff)
In pg_upgrade, remove unnecessary local variable.
-rw-r--r--contrib/pg_upgrade/server.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/pg_upgrade/server.c b/contrib/pg_upgrade/server.c
index f256e7f26e..8c4aec9918 100644
--- a/contrib/pg_upgrade/server.c
+++ b/contrib/pg_upgrade/server.c
@@ -101,27 +101,27 @@ executeQueryOrDie(PGconn *conn, const char *fmt,...)
/*
* get_major_server_version()
*
- * gets the version (in unsigned int form) for the given "datadir". Assumes
+ * gets the version (in unsigned int form) for the given datadir. Assumes
* that datadir is an absolute path to a valid pgdata directory. The version
* is retrieved by reading the PG_VERSION file.
*/
uint32
get_major_server_version(ClusterInfo *cluster)
{
- const char *datadir = cluster->pgdata;
FILE *version_fd;
char ver_filename[MAXPGPATH];
int integer_version = 0;
int fractional_version = 0;
- snprintf(ver_filename, sizeof(ver_filename), "%s/PG_VERSION", datadir);
+ snprintf(ver_filename, sizeof(ver_filename), "%s/PG_VERSION",
+ cluster->pgdata);
if ((version_fd = fopen(ver_filename, "r")) == NULL)
return 0;
if (fscanf(version_fd, "%63s", cluster->major_version_str) == 0 ||
sscanf(cluster->major_version_str, "%d.%d", &integer_version,
&fractional_version) != 2)
- pg_log(PG_FATAL, "could not get version from %s\n", datadir);
+ pg_log(PG_FATAL, "could not get version from %s\n", cluster->pgdata);
fclose(version_fd);