Skip to content

Commit 8085115

Browse files
authored
Merge pull request #271 from marfrit/Cog
Add fflush to sqFileTruncate. This is required since FILE* data structures can cache data, and a subsequent access by fd (file descriptor) may not see the latest contents.
2 parents 97b799c + 28152db commit 8085115

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,7 @@ sqInt
773773
sqFileTruncate(SQFile *f, squeakFileOffsetType offset) {
774774
if (!sqFileValid(f))
775775
return interpreterProxy->success(false);
776+
fflush(getFile(f));
776777
if (sqFTruncate(getFile(f), offset))
777778
return interpreterProxy->success(false);
778779
return 1;

0 commit comments

Comments
 (0)