diff options
author | Bruce Momjian <bruce@momjian.us> | 2015-11-24 17:18:27 -0500 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2015-11-24 17:18:27 -0500 |
commit | c36064e438c738fb305919874f22ef1e9b755a63 (patch) | |
tree | 38f3cb4d89945f69d83bac6b9dcf6e583494b945 /contrib/pg_upgrade/file.c | |
parent | 6df62ef43ef3455882ee2829986aae08f3e64aea (diff) |
pg_upgrade: fix CopyFile() on Windows to fail on file existence
Also fix getErrorText() to return the right error string on failure.
This behavior now matches that of other operating systems.
Report by Noah Misch
Backpatch through 9.1
Diffstat (limited to 'contrib/pg_upgrade/file.c')
-rw-r--r-- | contrib/pg_upgrade/file.c | 2 |
1 files changed, 1 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 |