aboutsummaryrefslogtreecommitdiff
path: root/bolt_unix_solaris.go
diff options
context:
space:
mode:
Diffstat (limited to 'bolt_unix_solaris.go')
-rw-r--r--bolt_unix_solaris.go13
1 files changed, 1 insertions, 12 deletions
diff --git a/bolt_unix_solaris.go b/bolt_unix_solaris.go
index f480ee7..13c800b 100644
--- a/bolt_unix_solaris.go
+++ b/bolt_unix_solaris.go
@@ -1,4 +1,3 @@
-
package bolt
import (
@@ -7,6 +6,7 @@ import (
"syscall"
"time"
"unsafe"
+
"golang.org/x/sys/unix"
)
@@ -56,17 +56,6 @@ func funlock(f *os.File) error {
// mmap memory maps a DB's data file.
func mmap(db *DB, sz int) error {
- // Truncate and fsync to ensure file size metadata is flushed.
- // https://github.com/boltdb/bolt/issues/284
- if !db.NoGrowSync && !db.readOnly {
- if err := db.file.Truncate(int64(sz)); err != nil {
- return fmt.Errorf("file resize error: %s", err)
- }
- if err := db.file.Sync(); err != nil {
- return fmt.Errorf("file sync error: %s", err)
- }
- }
-
// Map the data file to memory.
b, err := unix.Mmap(int(db.file.Fd()), 0, sz, syscall.PROT_READ, syscall.MAP_SHARED)
if err != nil {