mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit to master@9624ab4
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
11
vendor/github.com/gofrs/flock/flock.go
generated
vendored
11
vendor/github.com/gofrs/flock/flock.go
generated
vendored
@ -19,6 +19,7 @@ package flock
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"runtime"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
@ -116,7 +117,15 @@ func tryCtx(ctx context.Context, fn func() (bool, error), retryDelay time.Durati
|
||||
func (f *Flock) setFh() error {
|
||||
// open a new os.File instance
|
||||
// create it if it doesn't exist, and open the file read-only.
|
||||
fh, err := os.OpenFile(f.path, os.O_CREATE|os.O_RDONLY, os.FileMode(0600))
|
||||
flags := os.O_CREATE
|
||||
if runtime.GOOS == "aix" {
|
||||
// AIX cannot preform write-lock (ie exclusive) on a
|
||||
// read-only file.
|
||||
flags |= os.O_RDWR
|
||||
} else {
|
||||
flags |= os.O_RDONLY
|
||||
}
|
||||
fh, err := os.OpenFile(f.path, flags, os.FileMode(0600))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user