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

Commit025106e

Browse files
committed
pg_upgrade: properly detect file copy failure on Windows
Previously, file copy failures were ignored on Windows due to anincorrect return value check.Report by Manu JoyeBackpatch through 9.1
1 parent42aa1c0 commit025106e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

‎src/bin/pg_upgrade/file.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ copyAndUpdateFile(pageCnvCtx *pageConverter,
3434
{
3535
if (pageConverter==NULL)
3636
{
37-
if (pg_copy_file(src,dst,force)==-1)
37+
#ifndefWIN32
38+
if (copy_file(src,dst,force)==-1)
39+
#else
40+
if (CopyFile(src,dst,force)==0)
41+
#endif
3842
returngetErrorText(errno);
3943
else
4044
returnNULL;

‎src/bin/pg_upgrade/pg_upgrade.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ extern char *output_files[];
7070

7171

7272
#ifndefWIN32
73-
#definepg_copy_filecopy_file
7473
#definepg_mv_filerename
7574
#definepg_link_filelink
7675
#definePATH_SEPARATOR'/'
@@ -82,7 +81,6 @@ extern char *output_files[];
8281
#defineECHO_QUOTE"'"
8382
#defineECHO_BLANK""
8483
#else
85-
#definepg_copy_fileCopyFile
8684
#definepg_mv_filepgrename
8785
#definepg_link_filewin32_pghardlink
8886
#definePATH_SEPARATOR'\\'

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp