From ea2da05cd8b5f6700e92822740982ee2597ea01a Mon Sep 17 00:00:00 2001
From: Sean Cannella <seanc@fb.com>
Date: Tue, 23 Jul 2013 11:25:13 -0700
Subject: [PATCH] fix folly compilation on FreeBSD

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 | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/folly/FileUtil.cpp b/folly/FileUtil.cpp
index 2d9cabf8..4a4ca6b6 100644
--- a/folly/FileUtil.cpp
+++ b/folly/FileUtil.cpp
@@ -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
 }
 
-- 
2.34.1