diff options
author | Bruce Momjian | 2015-11-24 22:18:28 +0000 |
---|---|---|
committer | Bruce Momjian | 2015-11-24 22:18:28 +0000 |
commit | 13b30c16f3164ee70599adee251256bd069fa0e4 (patch) | |
tree | f05c1ad38d0aefeab81b16c5e544f7db3ee6fa71 /src/bin/pg_upgrade/version.c | |
parent | cbd96eff251bf92e88a13ef00df07c6caae0d411 (diff) |
pg_upgrade: fix CopyFile() on Windows to fail on file existence
Also fix getErrorText() to return the right error string on failure.
This behavior now matches that of other operating systems.
Report by Noah Misch
Backpatch through 9.1
Diffstat (limited to 'src/bin/pg_upgrade/version.c')
-rw-r--r-- | src/bin/pg_upgrade/version.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/pg_upgrade/version.c b/src/bin/pg_upgrade/version.c index 9954daea17e..b93c414d7a3 100644 --- a/src/bin/pg_upgrade/version.c +++ b/src/bin/pg_upgrade/version.c @@ -49,7 +49,7 @@ new_9_0_populate_pg_largeobject_metadata(ClusterInfo *cluster, bool check_mode) if (!check_mode) { if (script == NULL && (script = fopen_priv(output_path, "w")) == NULL) - pg_fatal("could not open file \"%s\": %s\n", output_path, getErrorText(errno)); + pg_fatal("could not open file \"%s\": %s\n", output_path, getErrorText()); fprintf(script, "\\connect %s\n", quote_identifier(active_db->db_name)); fprintf(script, @@ -143,7 +143,7 @@ old_9_3_check_for_line_data_type_usage(ClusterInfo *cluster) { found = true; if (script == NULL && (script = fopen_priv(output_path, "w")) == NULL) - pg_fatal("could not open file \"%s\": %s\n", output_path, getErrorText(errno)); + pg_fatal("could not open file \"%s\": %s\n", output_path, getErrorText()); if (!db_used) { fprintf(script, "Database: %s\n", active_db->db_name); |