From a2cbaa05f9720b15eb1eee7a05893ab992c289b5 Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Thu, 18 Sep 2014 15:15:52 -0500 Subject: Fix bolt on OpenBSD. OpenBSD does not include a UBC kernel and writes must be synchronized with the msync(2) syscall. In addition, the NoSync field of the DB struct should be ignored on OpenBSD, since unlike other platforms, missing msyncs will result in data corruption. Depends on PR #258. Fixes #257. --- boltsync_unix.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'boltsync_unix.go') diff --git a/boltsync_unix.go b/boltsync_unix.go index 3c54dd5..8db8977 100644 --- a/boltsync_unix.go +++ b/boltsync_unix.go @@ -1,14 +1,10 @@ -// +build !windows,!plan9,!linux +// +build !windows,!plan9,!linux,!openbsd package bolt -import ( - "os" -) - var odirect int // fdatasync flushes written data to a file descriptor. -func fdatasync(f *os.File) error { - return f.Sync() +func fdatasync(db *DB) error { + return db.file.Sync() } -- cgit v1.2.3