1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-06 18:42:54 +03:00

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
This commit is contained in:
Bruce Momjian
2015-11-14 11:47:11 -05:00
parent 7fe1d1cfbf
commit bdcbc2b471
2 changed files with 5 additions and 3 deletions

View File

@@ -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;