fix folly compilation on FreeBSD
authorSean Cannella <seanc@fb.com>
Tue, 23 Jul 2013 18:25:13 +0000 (11:25 -0700)
committerSara Golemon <sgolemon@fb.com>
Wed, 28 Aug 2013 21:30:11 +0000 (14:30 -0700)
Summary:
- fix folly compilation on FreeBSD

Github Author: Martin Matuska <martin@matuska.org>

Test Plan: - compiled

Reviewed By: tudorb@fb.com

FB internal diff: D896747

folly/FileUtil.cpp

index 2d9cabf872dab44c82095fbd24f30c09d787257d..4a4ca6b6264658c434e4707daeff7806b36fa973 100644 (file)
@@ -53,10 +53,12 @@ int fsyncNoInt(int fd) {
 }
 
 int fdatasyncNoInt(int fd) {
-#ifndef __APPLE__
-  return wrapNoInt(fdatasync, fd);
-#else
+#if defined(__APPLE__)
   return wrapNoInt(fcntl, fd, F_FULLFSYNC);
+#elif defined(__FreeBSD__)
+  return wrapNoInt(fsync, fd);
+#else
+  return wrapNoInt(fdatasync, fd);
 #endif
 }