mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
fflush(3) on fseeko(3).
This caused a corruption of the resulting file if the program fwrite some data that is buffered, then fseeks, and then fflushes. The fwrite will then happen at the wrong memory location. Flushing in fseeko(3) fixes the problem but it may cause violate some standard or just be inefficient.
This commit is contained in:
parent
910197ffa7
commit
a478dda4d9
1 changed files with 1 additions and 0 deletions
|
@ -27,5 +27,6 @@
|
||||||
extern "C" int fseeko(FILE* fp, off_t offset, int whence)
|
extern "C" int fseeko(FILE* fp, off_t offset, int whence)
|
||||||
{
|
{
|
||||||
fp->numpushedback = 0;
|
fp->numpushedback = 0;
|
||||||
|
fflush(fp);
|
||||||
return (fp->seek_func) ? fp->seek_func(fp->user, offset, whence) : 0;
|
return (fp->seek_func) ? fp->seek_func(fp->user, offset, whence) : 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue