diff options
author | 2024-08-15 00:30:58 +0000 | |
---|---|---|
committer | 2024-08-15 00:30:58 +0000 | |
commit | 586639ccf0e2fefbd1da2c59d5abcb8d64d37434 (patch) | |
tree | 52a9d7412e98ef406c39f09a6fad6e3fa7a7ad49 /vendor/github.com/ncruces/go-sqlite3/vfs/vfs.go | |
parent | update go-ffmpreg to v0.2.5 (pulls in latest tetratelabs/wazero) (#3203) (diff) | |
download | gotosocial-586639ccf0e2fefbd1da2c59d5abcb8d64d37434.tar.xz |
update go-sqlite3 to v0.18.0 (#3204)
Diffstat (limited to 'vendor/github.com/ncruces/go-sqlite3/vfs/vfs.go')
-rw-r--r-- | vendor/github.com/ncruces/go-sqlite3/vfs/vfs.go | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/vendor/github.com/ncruces/go-sqlite3/vfs/vfs.go b/vendor/github.com/ncruces/go-sqlite3/vfs/vfs.go index d624aa78c..983f28560 100644 --- a/vendor/github.com/ncruces/go-sqlite3/vfs/vfs.go +++ b/vendor/github.com/ncruces/go-sqlite3/vfs/vfs.go @@ -132,26 +132,20 @@ func vfsAccess(ctx context.Context, mod api.Module, pVfs, zPath uint32, flags Ac func vfsOpen(ctx context.Context, mod api.Module, pVfs, zPath, pFile uint32, flags OpenFlag, pOutFlags, pOutVFS uint32) _ErrorCode { vfs := vfsGet(mod, pVfs) - - var path string - if zPath != 0 { - path = util.ReadString(mod, zPath, _MAX_PATHNAME) - } + name := GetFilename(ctx, mod, zPath, flags) var file File var err error if ffs, ok := vfs.(VFSFilename); ok { - name := OpenFilename(ctx, mod, zPath, flags) file, flags, err = ffs.OpenFilename(name, flags) } else { - file, flags, err = vfs.Open(path, flags) + file, flags, err = vfs.Open(name.String(), flags) } if err != nil { return vfsErrorCode(err, _CANTOPEN) } if file, ok := file.(FilePowersafeOverwrite); ok { - name := OpenFilename(ctx, mod, zPath, flags) if b, ok := util.ParseBool(name.URIParameter("psow")); ok { file.SetPowersafeOverwrite(b) } @@ -169,10 +163,7 @@ func vfsOpen(ctx context.Context, mod api.Module, pVfs, zPath, pFile uint32, fla func vfsClose(ctx context.Context, mod api.Module, pFile uint32) _ErrorCode { err := vfsFileClose(ctx, mod, pFile) - if err != nil { - return vfsErrorCode(err, _IOERR_CLOSE) - } - return _OK + return vfsErrorCode(err, _IOERR_CLOSE) } func vfsRead(ctx context.Context, mod api.Module, pFile, zBuf uint32, iAmt int32, iOfst int64) _ErrorCode { @@ -195,10 +186,7 @@ func vfsWrite(ctx context.Context, mod api.Module, pFile, zBuf uint32, iAmt int3 buf := util.View(mod, zBuf, uint64(iAmt)) _, err := file.WriteAt(buf, iOfst) - if err != nil { - return vfsErrorCode(err, _IOERR_WRITE) - } - return _OK + return vfsErrorCode(err, _IOERR_WRITE) } func vfsTruncate(ctx context.Context, mod api.Module, pFile uint32, nByte int64) _ErrorCode { |