fix: lock access mode is invalid
Signed-off-by: sisungo <[email protected]>
This commit is contained in:
+4
-1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user