aboutsummaryrefslogtreecommitdiff
path: root/bolt_linux.go
diff options
context:
space:
mode:
authorJosh Rickmar <jrick@conformal.com>2014-09-18 15:15:52 -0500
committerDave Collins <davec@conformal.com>2014-09-18 18:14:50 -0500
commita2cbaa05f9720b15eb1eee7a05893ab992c289b5 (patch)
treea69b6978e0c1231f5f051aabe6d16c7e9744c2c6 /bolt_linux.go
parentRework build to support more liberal unix variants. (diff)
downloaddedo-a2cbaa05f9720b15eb1eee7a05893ab992c289b5.tar.gz
dedo-a2cbaa05f9720b15eb1eee7a05893ab992c289b5.tar.xz
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.
Diffstat (limited to 'bolt_linux.go')
-rw-r--r--bolt_linux.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/bolt_linux.go b/bolt_linux.go
index 7e3e539..e9d1c90 100644
--- a/bolt_linux.go
+++ b/bolt_linux.go
@@ -1,13 +1,12 @@
package bolt
import (
- "os"
"syscall"
)
var odirect = syscall.O_DIRECT
// fdatasync flushes written data to a file descriptor.
-func fdatasync(f *os.File) error {
- return syscall.Fdatasync(int(f.Fd()))
+func fdatasync(db *DB) error {
+ return syscall.Fdatasync(int(db.file.Fd()))
}