diff options
author | 2024-12-17 23:16:20 +0000 | |
---|---|---|
committer | 2024-12-17 23:16:20 +0000 | |
commit | c953f57e55810fa0e3201a67a4622fe4ac39c278 (patch) | |
tree | 6b059966b98e4a687d6d55e98772bd3f7c8b1da7 /vendor/github.com/ncruces/go-sqlite3/vfs/shm_dotlk.go | |
parent | bump ncruces/go-sqlite3 to v0.21.1 (#3625) (diff) | |
download | gotosocial-c953f57e55810fa0e3201a67a4622fe4ac39c278.tar.xz |
update ncruces/go-sqlite3 to v0.21.2 (#3626)
Diffstat (limited to 'vendor/github.com/ncruces/go-sqlite3/vfs/shm_dotlk.go')
-rw-r--r-- | vendor/github.com/ncruces/go-sqlite3/vfs/shm_dotlk.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/vendor/github.com/ncruces/go-sqlite3/vfs/shm_dotlk.go b/vendor/github.com/ncruces/go-sqlite3/vfs/shm_dotlk.go index e302db7e6..17fefe562 100644 --- a/vendor/github.com/ncruces/go-sqlite3/vfs/shm_dotlk.go +++ b/vendor/github.com/ncruces/go-sqlite3/vfs/shm_dotlk.go @@ -6,11 +6,11 @@ import ( "context" "errors" "io/fs" - "os" "sync" "github.com/tetratelabs/wazero/api" + "github.com/ncruces/go-sqlite3/internal/dotlk" "github.com/ncruces/go-sqlite3/internal/util" ) @@ -58,8 +58,7 @@ func (s *vfsShm) Close() error { return nil } - err := os.Remove(s.path) - if err != nil && !errors.Is(err, fs.ErrNotExist) { + if err := dotlk.Unlock(s.path); err != nil { return _IOERR_UNLOCK } delete(vfsShmList, s.path) @@ -82,9 +81,8 @@ func (s *vfsShm) shmOpen() _ErrorCode { return _OK } - // Create a directory on disk to ensure only this process - // uses this path to register a shared memory. - err := os.Mkdir(s.path, 0777) + // Dead man's switch. + err := dotlk.LockShm(s.path) if errors.Is(err, fs.ErrExist) { return _BUSY } |