mirror of https://github.com/aria2/aria2
BufferedFile: Flush content on close
parent
307d8e779e
commit
431fcde29a
|
@ -80,6 +80,12 @@ int BufferedFile::onClose()
|
||||||
{
|
{
|
||||||
int rv = 0;
|
int rv = 0;
|
||||||
if (fp_) {
|
if (fp_) {
|
||||||
|
fflush(fp_);
|
||||||
|
#ifndef __MINGW32__
|
||||||
|
fsync(fileno(fp_));
|
||||||
|
#else // __MINGW32__
|
||||||
|
_commit(fileno(fp_));
|
||||||
|
#endif // __MINGW32__
|
||||||
rv = fclose(fp_);
|
rv = fclose(fp_);
|
||||||
fp_ = nullptr;
|
fp_ = nullptr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue