fix: lock access mode is invalid

Signed-off-by: sisungo <[email protected]>
This commit is contained in:
2026-07-10 15:30:29 +08:00
parent 1c154e7675
commit 18000610b9
+4 -1
View File
@@ -171,7 +171,10 @@ impl LockGuard {
}
pub fn open(path: impl AsRef<Path>, nonblocking: bool) -> std::io::Result<Self> {
let file = std::fs::File::options().create(true).open(path)?;
let file = std::fs::File::options()
.create(true)
.write(true)
.open(path)?;
let flags = if nonblocking {
nix::fcntl::FlockArg::LockExclusiveNonblock
} else {