From bdcbc2b47141cb84e6cd951fa7feef9cedce231a Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Sat, 14 Nov 2015 11:47:11 -0500 Subject: pg_upgrade: properly detect file copy failure on Windows Previously, file copy failures were ignored on Windows due to an incorrect return value check. Report by Manu Joye Backpatch through 9.1 --- contrib/pg_upgrade/file.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'contrib/pg_upgrade/file.c') diff --git a/contrib/pg_upgrade/file.c b/contrib/pg_upgrade/file.c index de23dedbf2b..2aa48f049ad 100644 --- a/contrib/pg_upgrade/file.c +++ b/contrib/pg_upgrade/file.c @@ -38,7 +38,11 @@ copyAndUpdateFile(pageCnvCtx *pageConverter, { if (pageConverter == NULL) { - if (pg_copy_file(src, dst, force) == -1) +#ifndef WIN32 + if (copy_file(src, dst, force) == -1) +#else + if (CopyFile(src, dst, force) == 0) +#endif return getErrorText(errno); else return NULL; -- cgit v1.2.3