Skip to content

Commit 5ae9944

Browse files
committed
Prepare 3.51.0.
1 parent b65e894 commit 5ae9944

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

internal/util/module.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ func GetSystemError(ctx context.Context) error {
3131
}
3232

3333
func SetSystemError(ctx context.Context, err error) {
34-
s, ok := ctx.Value(moduleKey{}).(*moduleState)
35-
if ok {
36-
s.sysError = err
37-
}
34+
s := ctx.Value(moduleKey{}).(*moduleState)
35+
s.sysError = err
3836
}

vfs/adiantum/hbsh.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func (h *hbshVFS) OpenFilename(name *vfs.Filename, flags vfs.OpenFlag) (file vfs
5656

5757
if hbsh == nil {
5858
file.Close()
59-
return nil, flags, sqlite3.CANTOPEN
59+
return nil, flags, sqlite3.IOERR_BADKEY
6060
}
6161
return &hbshFile{File: file, hbsh: hbsh, init: h.init}, flags, nil
6262
}
@@ -108,7 +108,7 @@ func (h *hbshFile) Pragma(name string, value string) (string, error) {
108108
if h.hbsh = h.init.HBSH(key); h.hbsh != nil {
109109
return "ok", nil
110110
}
111-
return "", sqlite3.CANTOPEN
111+
return "", sqlite3.IOERR_BADKEY
112112
}
113113

114114
func (h *hbshFile) ReadAt(p []byte, off int64) (n int, err error) {

vfs/api.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,10 @@ type blockingSharedMemory interface {
207207
shmEnableBlocking(block bool)
208208
}
209209

210+
// FileControl makes it easy to forward all fileControl methods,
211+
// which we want to do for the checksum VFS.
212+
// However, this is not a safe default, and other VFSes
213+
// should explicitly wrap the methods they want to wrap.
210214
type fileControl interface {
211215
File
212216
fileControl(ctx context.Context, mod api.Module, op _FcntlOpcode, pArg ptr_t) _ErrorCode

vfs/xts/xts.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (x *xtsVFS) OpenFilename(name *vfs.Filename, flags vfs.OpenFlag) (file vfs.
5555

5656
if cipher == nil {
5757
file.Close()
58-
return nil, flags, sqlite3.CANTOPEN
58+
return nil, flags, sqlite3.IOERR_BADKEY
5959
}
6060
return &xtsFile{File: file, cipher: cipher, init: x.init}, flags, nil
6161
}
@@ -103,7 +103,7 @@ func (x *xtsFile) Pragma(name string, value string) (string, error) {
103103
if x.cipher = x.init.XTS(key); x.cipher != nil {
104104
return "ok", nil
105105
}
106-
return "", sqlite3.CANTOPEN
106+
return "", sqlite3.IOERR_BADKEY
107107
}
108108

109109
func (x *xtsFile) ReadAt(p []byte, off int64) (n int, err error) {

0 commit comments

Comments
 (0)