From b17dbf26293e3805b5f7ab5a11a8e3f984c476ad Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Tue, 24 Nov 2015 17:18:28 -0500 Subject: 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 --- src/bin/pg_upgrade/function.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bin/pg_upgrade/function.c') diff --git a/src/bin/pg_upgrade/function.c b/src/bin/pg_upgrade/function.c index 04492a5cee4..0fb8c31104b 100644 --- a/src/bin/pg_upgrade/function.c +++ b/src/bin/pg_upgrade/function.c @@ -214,7 +214,7 @@ check_loadable_libraries(void) if (script == NULL && (script = fopen_priv(output_path, "w")) == NULL) pg_fatal("Could not open file \"%s\": %s\n", - output_path, getErrorText(errno)); + output_path, getErrorText()); fprintf(script, "Could not load library \"%s\"\n%s\n", lib, PQerrorMessage(conn)); -- cgit v1.2.3