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

Commitd672166

Browse files
committed
Use _chsize_s on windows to grow file
Looks like "seek after file end and write" doesn't workcorrectly in Windows. We have to grow file before.Met occasionally on GitHub actions run. Could not reproducelocally.
1 parentb7551bd commitd672166

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎src/utils/file.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2717,6 +2717,14 @@ fio_send_file_write(FILE* out, send_file_state* st, char *buf, size_t len)
27172717
if (len==0)
27182718
return true;
27192719

2720+
#ifdefWIN32
2721+
if (st->read_size>st->write_size&&
2722+
_chsize_s(fileno(out),st->read_size)!=0)
2723+
{
2724+
elog(WARNING,"Could not change file size to %lld: %m",st->read_size);
2725+
return false;
2726+
}
2727+
#endif
27202728
if (st->read_size>st->write_size&&
27212729
fseeko(out,st->read_size,SEEK_SET)!=0)
27222730
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp