Skip to content

Commit

Permalink
Merge pull request #271 from marfrit/Cog
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
akgrant43 authored Jul 22, 2018
2 parents 97b799c + 28152db commit 8085115
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,7 @@ sqInt
sqFileTruncate(SQFile *f, squeakFileOffsetType offset) {
if (!sqFileValid(f))
return interpreterProxy->success(false);
fflush(getFile(f));
if (sqFTruncate(getFile(f), offset))
return interpreterProxy->success(false);
return 1;
Expand Down

0 comments on commit 8085115

Please sign in to comment.