summaryrefslogtreecommitdiff
path: root/vendor/github.com/ncruces/go-sqlite3/vfs/os_unix.go
diff options
context:
space:
mode:
authorLibravatar kim <grufwub@gmail.com>2025-11-05 21:58:38 +0100
committerLibravatar tobi <tobi.smethurst@protonmail.com>2025-11-17 14:12:41 +0100
commitd0c551acb5ab79efafd325f5b19c76a3de835356 (patch)
treeba9462cdc5081015fbd6bf5d98d9f39334d13207 /vendor/github.com/ncruces/go-sqlite3/vfs/os_unix.go
parent[performance] when transforming media, perform read operations of large files... (diff)
downloadgotosocial-d0c551acb5ab79efafd325f5b19c76a3de835356.tar.xz
[chore] update dependencies (#4542)
- github.com/minio/minio-go/v7: v7.0.95 -> v7.0.97 - github.com/ncruces/go-sqlite3: v0.29.1 -> v0.30.0 - github.com/tdewolff/minify/v2: v2.24.5 -> v2.24.6 - codeberg.org/gruf/go-mmap: fixes build for BSD platforms Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4542 Co-authored-by: kim <grufwub@gmail.com> Co-committed-by: kim <grufwub@gmail.com>
Diffstat (limited to 'vendor/github.com/ncruces/go-sqlite3/vfs/os_unix.go')
-rw-r--r--vendor/github.com/ncruces/go-sqlite3/vfs/os_unix.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/vendor/github.com/ncruces/go-sqlite3/vfs/os_unix.go b/vendor/github.com/ncruces/go-sqlite3/vfs/os_unix.go
index ec312ccd3..69fdc8fbe 100644
--- a/vendor/github.com/ncruces/go-sqlite3/vfs/os_unix.go
+++ b/vendor/github.com/ncruces/go-sqlite3/vfs/os_unix.go
@@ -33,7 +33,7 @@ func osReadAt(file *os.File, p []byte, off int64) (int, error) {
unix.ERANGE,
unix.EIO,
unix.ENXIO:
- return n, _IOERR_CORRUPTFS
+ return n, sysError{err, _IOERR_CORRUPTFS}
}
}
return n, err
@@ -42,7 +42,7 @@ func osReadAt(file *os.File, p []byte, off int64) (int, error) {
func osWriteAt(file *os.File, p []byte, off int64) (int, error) {
n, err := file.WriteAt(p, off)
if errno, ok := err.(unix.Errno); ok && errno == unix.ENOSPC {
- return n, _FULL
+ return n, sysError{err, _FULL}
}
return n, err
}
@@ -59,7 +59,7 @@ func osSetMode(file *os.File, modeof string) error {
return nil
}
-func osTestLock(file *os.File, start, len int64) (int16, _ErrorCode) {
+func osTestLock(file *os.File, start, len int64, def _ErrorCode) (int16, error) {
lock := unix.Flock_t{
Type: unix.F_WRLCK,
Start: start,
@@ -68,17 +68,17 @@ func osTestLock(file *os.File, start, len int64) (int16, _ErrorCode) {
for {
err := unix.FcntlFlock(file.Fd(), unix.F_GETLK, &lock)
if err == nil {
- return lock.Type, _OK
+ return lock.Type, nil
}
if err != unix.EINTR {
- return 0, _IOERR_CHECKRESERVEDLOCK
+ return 0, sysError{err, def}
}
}
}
-func osLockErrorCode(err error, def _ErrorCode) _ErrorCode {
+func osLockErrorCode(err error, def _ErrorCode) error {
if err == nil {
- return _OK
+ return nil
}
if errno, ok := err.(unix.Errno); ok {
switch errno {
@@ -92,12 +92,12 @@ func osLockErrorCode(err error, def _ErrorCode) _ErrorCode {
unix.ETIMEDOUT:
return _BUSY
case unix.EPERM:
- return _PERM
+ return sysError{err, _PERM}
}
// notest // usually EWOULDBLOCK == EAGAIN
if errno == unix.EWOULDBLOCK && unix.EWOULDBLOCK != unix.EAGAIN {
return _BUSY
}
}
- return def
+ return sysError{err, def}
}