Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6638c9a

Browse files
committed
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 MischBackpatch through 9.1
1 parent0e61852 commit6638c9a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

‎contrib/pg_upgrade/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ copyAndUpdateFile(pageCnvCtx *pageConverter,
3737
#ifndefWIN32
3838
if (copy_file(src,dst,force)==-1)
3939
#else
40-
if (CopyFile(src,dst,force)==0)
40+
if (CopyFile(src,dst,!force)==0)
4141
#endif
4242
returngetErrorText(errno);
4343
else

‎contrib/pg_upgrade/util.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ getErrorText(int errNum)
226226
{
227227
#ifdefWIN32
228228
_dosmaperr(GetLastError());
229+
/* _dosmaperr sets errno, so we copy errno here */
230+
errNum=errno;
229231
#endif
230232
returnpg_strdup(strerror(errNum));
231233
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp