1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +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 db6e8e1624
commit a75efb4836
2 changed files with 5 additions and 3 deletions

View File

@ -34,7 +34,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;