diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2016-03-10 12:43:05 -0700 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2016-03-10 12:43:05 -0700 |
commit | 0fd4c0547d204c7b1cad6db6f3adad5f2cf453e5 (patch) | |
tree | 892937cdc21a4a82d17da5961eab1afc5263b695 /bolt_unix_solaris.go | |
parent | Merge pull request #515 from benbjohnson/meta-write-to (diff) | |
parent | move to separate lock file on windows (diff) | |
download | dedo-0fd4c0547d204c7b1cad6db6f3adad5f2cf453e5.tar.gz dedo-0fd4c0547d204c7b1cad6db6f3adad5f2cf453e5.tar.xz |
Merge pull request #528 from boltdb/windows
Move to separate lock file on windows
Diffstat (limited to 'bolt_unix_solaris.go')
-rw-r--r-- | bolt_unix_solaris.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bolt_unix_solaris.go b/bolt_unix_solaris.go index 1c4e48d..307bf2b 100644 --- a/bolt_unix_solaris.go +++ b/bolt_unix_solaris.go @@ -11,7 +11,7 @@ import ( ) // flock acquires an advisory lock on a file descriptor. -func flock(f *os.File, exclusive bool, timeout time.Duration) error { +func flock(db *DB, mode os.FileMode, exclusive bool, timeout time.Duration) error { var t time.Time for { // If we're beyond our timeout then return an error. @@ -32,7 +32,7 @@ func flock(f *os.File, exclusive bool, timeout time.Duration) error { } else { lock.Type = syscall.F_RDLCK } - err := syscall.FcntlFlock(f.Fd(), syscall.F_SETLK, &lock) + err := syscall.FcntlFlock(db.file.Fd(), syscall.F_SETLK, &lock) if err == nil { return nil } else if err != syscall.EAGAIN { @@ -45,13 +45,13 @@ func flock(f *os.File, exclusive bool, timeout time.Duration) error { } // funlock releases an advisory lock on a file descriptor. -func funlock(f *os.File) error { +func funlock(db *DB) error { var lock syscall.Flock_t lock.Start = 0 lock.Len = 0 lock.Type = syscall.F_UNLCK lock.Whence = 0 - return syscall.FcntlFlock(uintptr(f.Fd()), syscall.F_SETLK, &lock) + return syscall.FcntlFlock(uintptr(db.file.Fd()), syscall.F_SETLK, &lock) } // mmap memory maps a DB's data file. |