diff options
Diffstat (limited to 'vendor/github.com/ncruces/go-sqlite3/vfs/os_darwin.go')
| -rw-r--r-- | vendor/github.com/ncruces/go-sqlite3/vfs/os_darwin.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/vendor/github.com/ncruces/go-sqlite3/vfs/os_darwin.go b/vendor/github.com/ncruces/go-sqlite3/vfs/os_darwin.go index 9bb8b559c..6748c2991 100644 --- a/vendor/github.com/ncruces/go-sqlite3/vfs/os_darwin.go +++ b/vendor/github.com/ncruces/go-sqlite3/vfs/os_darwin.go @@ -75,15 +75,15 @@ func osAllocate(file *os.File, size int64) error { return file.Truncate(size) } -func osReadLock(file *os.File, start, len int64, timeout time.Duration) _ErrorCode { +func osReadLock(file *os.File, start, len int64, timeout time.Duration) error { return osLock(file, unix.F_RDLCK, start, len, timeout, _IOERR_RDLOCK) } -func osWriteLock(file *os.File, start, len int64, timeout time.Duration) _ErrorCode { +func osWriteLock(file *os.File, start, len int64, timeout time.Duration) error { return osLock(file, unix.F_WRLCK, start, len, timeout, _IOERR_LOCK) } -func osLock(file *os.File, typ int16, start, len int64, timeout time.Duration, def _ErrorCode) _ErrorCode { +func osLock(file *os.File, typ int16, start, len int64, timeout time.Duration, def _ErrorCode) error { lock := &flocktimeout_t{fl: unix.Flock_t{ Type: typ, Start: start, @@ -103,7 +103,7 @@ func osLock(file *os.File, typ int16, start, len int64, timeout time.Duration, d return osLockErrorCode(err, def) } -func osUnlock(file *os.File, start, len int64) _ErrorCode { +func osUnlock(file *os.File, start, len int64) error { lock := unix.Flock_t{ Type: unix.F_UNLCK, Start: start, @@ -112,10 +112,10 @@ func osUnlock(file *os.File, start, len int64) _ErrorCode { for { err := unix.FcntlFlock(file.Fd(), _F_OFD_SETLK, &lock) if err == nil { - return _OK + return nil } if err != unix.EINTR { - return _IOERR_UNLOCK + return sysError{err, _IOERR_UNLOCK} } } } |
