freebsd, openbsd: don't use fdatasync()

The fdatasync() system call does not exist on either FreeBSD or OpenBSD, fall
back to fsync().
This commit is contained in:
Ben Noordhuis 2012-10-06 17:19:09 +02:00
parent 7aa1261769
commit 7833df14ba

View File

@ -98,10 +98,12 @@
static ssize_t uv__fs_fdatasync(uv_fs_t* req) {
#if defined(__APPLE__) && defined(F_FULLFSYNC)
#if defined(__linux__) || defined(__sun) || defined(__NetBSD__)
return fdatasync(req->file);
#elif defined(__APPLE__) && defined(F_FULLFSYNC)
return fcntl(req->file, F_FULLFSYNC);
#else
return fdatasync(req->file);
return fsync(req->file);
#endif
}