Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

unix: darwin < 10.6 does not have fdatasync, use fsync

  • Loading branch information...
bnoordhuis committed Sep 24, 2011
1 parent 3ca382b commit 8f617b93bcb3e4b54fd4fa33883b14bad014dfc0
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/unix/fs.c
@@ -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))

0 comments on commit 8f617b9

Please sign in to comment.
You can’t perform that action at this time.