Skip to content

Commit

Permalink
Merge pull request #1030 from rhatdan/cleanup
Browse files Browse the repository at this point in the history
Create readonly locks if the lockfile does not exists
  • Loading branch information
rhatdan committed Sep 29, 2021
2 parents 2aad979 + 162a0bf commit fdc780e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/lockfile/lockfile_unix.go
Expand Up @@ -36,7 +36,7 @@ type lockfile struct {
// necessary.
func openLock(path string, ro bool) (fd int, err error) {
if ro {
fd, err = unix.Open(path, os.O_RDONLY|unix.O_CLOEXEC, 0)
fd, err = unix.Open(path, os.O_RDONLY|unix.O_CLOEXEC|os.O_CREATE, 0)
} else {
fd, err = unix.Open(path,
os.O_RDWR|unix.O_CLOEXEC|os.O_CREATE,
Expand Down

0 comments on commit fdc780e

Please sign in to comment.