Use F_FULLFSYNC instead of fsync on Darwin.
GitOrigin-RevId: 05a7bc0683641a679b026b6d636fa127fe104123
This commit is contained in:
parent
bedd80c23a
commit
272608a5fb
@ -468,7 +468,11 @@ Stat FileFd::stat() {
|
|||||||
Status FileFd::sync() {
|
Status FileFd::sync() {
|
||||||
CHECK(!empty());
|
CHECK(!empty());
|
||||||
#if TD_PORT_POSIX
|
#if TD_PORT_POSIX
|
||||||
|
#if TD_DARWIN
|
||||||
|
if (fcntl(get_native_fd().fd(), F_FULLFSYNC) == -1) {
|
||||||
|
#else
|
||||||
if (fsync(get_native_fd().fd()) != 0) {
|
if (fsync(get_native_fd().fd()) != 0) {
|
||||||
|
#endif
|
||||||
#elif TD_PORT_WINDOWS
|
#elif TD_PORT_WINDOWS
|
||||||
if (FlushFileBuffers(get_native_fd().fd()) == 0) {
|
if (FlushFileBuffers(get_native_fd().fd()) == 0) {
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user