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

Commitd6908b3

Browse files
committed
Fix open file mode
1 parent6114c47 commitd6908b3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

‎src/data.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ restore_data_file(const char *to_path, pgFile *file, bool allow_truncate,
711711
* modified pages for differential restore. If the file does not exist,
712712
* re-open it with "w" to create an empty file.
713713
*/
714-
out=fio_fopen(to_path,PG_BINARY_W"+",FIO_DB_HOST);
714+
out=fio_fopen(to_path,PG_BINARY_R"+",FIO_DB_HOST);
715715
if (out==NULL)
716716
{
717717
interrno_tmp=errno;

‎src/utils/file.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ FILE* fio_fopen(char const* path, char const* mode, fio_location location)
275275
else
276276
{
277277
f=fopen(path,mode);
278+
if (f==NULL&&strcmp(mode,PG_BINARY_R"+")==0)
279+
f=fopen(path,PG_BINARY_W);
278280
}
279281
returnf;
280282
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp