Skip to content

Commit 878b74e

Browse files
committed
In pg_upgrade, remove unnecessary local variable.
1 parent 0a5d5a4 commit 878b74e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

contrib/pg_upgrade/server.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,27 +101,27 @@ executeQueryOrDie(PGconn *conn, const char *fmt,...)
101101
/*
102102
* get_major_server_version()
103103
*
104-
* gets the version (in unsigned int form) for the given "datadir". Assumes
104+
* gets the version (in unsigned int form) for the given datadir. Assumes
105105
* that datadir is an absolute path to a valid pgdata directory. The version
106106
* is retrieved by reading the PG_VERSION file.
107107
*/
108108
uint32
109109
get_major_server_version(ClusterInfo *cluster)
110110
{
111-
const char *datadir = cluster->pgdata;
112111
FILE *version_fd;
113112
char ver_filename[MAXPGPATH];
114113
int integer_version = 0;
115114
int fractional_version = 0;
116115

117-
snprintf(ver_filename, sizeof(ver_filename), "%s/PG_VERSION", datadir);
116+
snprintf(ver_filename, sizeof(ver_filename), "%s/PG_VERSION",
117+
cluster->pgdata);
118118
if ((version_fd = fopen(ver_filename, "r")) == NULL)
119119
return 0;
120120

121121
if (fscanf(version_fd, "%63s", cluster->major_version_str) == 0 ||
122122
sscanf(cluster->major_version_str, "%d.%d", &integer_version,
123123
&fractional_version) != 2)
124-
pg_log(PG_FATAL, "could not get version from %s\n", datadir);
124+
pg_log(PG_FATAL, "could not get version from %s\n", cluster->pgdata);
125125

126126
fclose(version_fd);
127127

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