Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
unix: darwin < 10.6 does not have fdatasync, use fsync
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis committed Sep 24, 2011
1 parent 3ca382b commit 8f617b9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/unix/fs.c
Expand Up @@ -447,8 +447,11 @@ int uv_fs_fsync(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) {

int uv_fs_fdatasync(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) {
char* path = NULL;
#ifdef __FreeBSD__
/* freebsd doesn't have fdatasync, do a full fsync instead. */
#if defined(__FreeBSD__) \
|| (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1060)
/* freebsd and pre-10.6 darwin don't have fdatasync,
* do a full fsync instead.
*/
WRAP_EIO(UV_FS_FDATASYNC, eio_fdatasync, fsync, ARGS1(file))
#else
WRAP_EIO(UV_FS_FDATASYNC, eio_fdatasync, fdatasync, ARGS1(file))
Expand Down

0 comments on commit 8f617b9

Please sign in to comment.