diff options
author | Bruce Momjian <bruce@momjian.us> | 2015-11-14 11:47:11 -0500 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2015-11-14 11:47:11 -0500 |
commit | bdcbc2b47141cb84e6cd951fa7feef9cedce231a (patch) | |
tree | 56bfdb78d3fab7b14cd46b91d71a5a7eb1394f1b /contrib/pg_upgrade/file.c | |
parent | 7fe1d1cfbfaf190ccba576a50214378f6a262325 (diff) |
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
Diffstat (limited to 'contrib/pg_upgrade/file.c')
-rw-r--r-- | contrib/pg_upgrade/file.c | 6 |
1 files changed, 5 insertions, 1 deletions
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; |