mirror of
https://github.com/postgres/postgres.git
synced 2025-05-08 07:21:33 +03:00
Include error code in message from pg_upgrade
In passing, also quote the filename in one message where it wasn't. Author: Dagfinn Ilmari Mannsåker Discussion: https://postgr.es/m/87pne2w98h.fsf@wibble.ilmari.org
This commit is contained in:
parent
59f9cd9dd5
commit
4109bb5de4
@ -164,11 +164,11 @@ get_major_server_version(ClusterInfo *cluster)
|
|||||||
snprintf(ver_filename, sizeof(ver_filename), "%s/PG_VERSION",
|
snprintf(ver_filename, sizeof(ver_filename), "%s/PG_VERSION",
|
||||||
cluster->pgdata);
|
cluster->pgdata);
|
||||||
if ((version_fd = fopen(ver_filename, "r")) == NULL)
|
if ((version_fd = fopen(ver_filename, "r")) == NULL)
|
||||||
pg_fatal("could not open version file: %s\n", ver_filename);
|
pg_fatal("could not open version file \"%s\": %m\n", ver_filename);
|
||||||
|
|
||||||
if (fscanf(version_fd, "%63s", cluster->major_version_str) == 0 ||
|
if (fscanf(version_fd, "%63s", cluster->major_version_str) == 0 ||
|
||||||
sscanf(cluster->major_version_str, "%d.%d", &v1, &v2) < 1)
|
sscanf(cluster->major_version_str, "%d.%d", &v1, &v2) < 1)
|
||||||
pg_fatal("could not parse PG_VERSION file from %s\n", cluster->pgdata);
|
pg_fatal("could not parse PG_VERSION file from \"%s\"\n", cluster->pgdata);
|
||||||
|
|
||||||
fclose(version_fd);
|
fclose(version_fd);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user