open() flag O_DSYNC isn't on BSD, use O_SYNC

If the detected OS is FreeBSD, tell LMDB to compile with
MDB_DSYNC=O_SYNC instead of the default O_DSYNC, as BSD does not
implement this flag.
This commit is contained in:
Thomas Winget 2015-05-26 19:47:34 -04:00 committed by Riccardo Spagni
parent 5de12913dc
commit ea08c768e2
2 changed files with 8 additions and 0 deletions

View file

@ -26,6 +26,10 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if(FREEBSD)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMDB_DSYNC=O_SYNC")
endif()
set (lmdb_sources
mdb.c
midl.c)

View file

@ -26,6 +26,10 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if(FREEBSD)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMDB_DSYNC=O_SYNC")
endif()
set (lmdb_sources
mdb.c
midl.c)