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/internal/dotlk/dotlk_other.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/internal/dotlk/dotlk_other.go')
-rw-r--r-- | vendor/github.com/ncruces/go-sqlite3/internal/dotlk/dotlk_other.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/vendor/github.com/ncruces/go-sqlite3/internal/dotlk/dotlk_other.go b/vendor/github.com/ncruces/go-sqlite3/internal/dotlk/dotlk_other.go new file mode 100644 index 000000000..5399a5f8a --- /dev/null +++ b/vendor/github.com/ncruces/go-sqlite3/internal/dotlk/dotlk_other.go @@ -0,0 +1,13 @@ +//go:build !unix + +package dotlk + +import "os" + +// TryLock returns nil if it acquired the lock, +// fs.ErrExist if another process has the lock. +func TryLock(name string) error { + f, err := os.OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0666) + f.Close() + return err +} |