summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/pg_upgrade/file.c2
-rw-r--r--contrib/pg_upgrade/util.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/contrib/pg_upgrade/file.c b/contrib/pg_upgrade/file.c
index 2aa48f049ad..fc78a06d8fb 100644
--- a/contrib/pg_upgrade/file.c
+++ b/contrib/pg_upgrade/file.c
@@ -41,7 +41,7 @@ copyAndUpdateFile(pageCnvCtx *pageConverter,
#ifndef WIN32
if (copy_file(src, dst, force) == -1)
#else
- if (CopyFile(src, dst, force) == 0)
+ if (CopyFile(src, dst, !force) == 0)
#endif
return getErrorText(errno);
else
diff --git a/contrib/pg_upgrade/util.c b/contrib/pg_upgrade/util.c
index 27dcd22a9b3..c32cfcae645 100644
--- a/contrib/pg_upgrade/util.c
+++ b/contrib/pg_upgrade/util.c
@@ -229,6 +229,8 @@ getErrorText(int errNum)
{
#ifdef WIN32
_dosmaperr(GetLastError());
+ /* _dosmaperr sets errno, so we copy errno here */
+ errNum = errno;
#endif
return strdup(strerror(errNum));
}