Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit878b74e

Browse files
committed
In pg_upgrade, remove unnecessary local variable.
1 parent0a5d5a4 commit878b74e

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-
constchar*datadir=cluster->pgdata;
112111
FILE*version_fd;
113112
charver_filename[MAXPGPATH];
114113
intinteger_version=0;
115114
intfractional_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
return0;
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)

[8]ページ先頭

©2009-2025 Movatter.jp