Commit 5309963f authored by Dan Melnic's avatar Dan Melnic Committed by Facebook GitHub Bot

fsync the temp file

Summary: fsync the temp file

Reviewed By: yfeldblum, kevin-vigor

Differential Revision: D21668049

fbshipit-source-id: 85825f81dfbe10a452f7f946133bb3d8993850f8
parent 51bad111
......@@ -70,6 +70,11 @@ TemporaryFile::TemporaryFile(size_t size)
PCHECK(written == n);
size -= written;
}
// make sure the buffers are flushed
int ret = ::fflush(fp);
PCHECK(ret == 0);
ret = ::fdatasync(::fileno(fp));
PCHECK(ret == 0);
PCHECK(::fclose(fp) == 0);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment