Merge pull request #1186 from estesp/update-fifo-racefix
Update containerd/fifo for race fix
This commit is contained in:
commit
bf67906370
@ -21,7 +21,7 @@ github.com/containerd/btrfs e9c546f46bccffefe71a6bc137e4c21b5503cc18
|
|||||||
github.com/stretchr/testify v1.1.4
|
github.com/stretchr/testify v1.1.4
|
||||||
github.com/davecgh/go-spew v1.1.0
|
github.com/davecgh/go-spew v1.1.0
|
||||||
github.com/pmezard/go-difflib v1.0.0
|
github.com/pmezard/go-difflib v1.0.0
|
||||||
github.com/containerd/fifo 69b99525e472735860a5269b75af1970142b3062
|
github.com/containerd/fifo fbfb6a11ec671efbe94ad1c12c2e98773f19e1e6
|
||||||
github.com/urfave/cli 8ba6f23b6e36d03666a14bd9421f5e3efcb59aca
|
github.com/urfave/cli 8ba6f23b6e36d03666a14bd9421f5e3efcb59aca
|
||||||
golang.org/x/net 7dcfb8076726a3fdd9353b6b8a1f1b6be6811bd6
|
golang.org/x/net 7dcfb8076726a3fdd9353b6b8a1f1b6be6811bd6
|
||||||
google.golang.org/grpc v1.3.0
|
google.golang.org/grpc v1.3.0
|
||||||
|
13
vendor/github.com/containerd/fifo/handle_linux.go
generated
vendored
13
vendor/github.com/containerd/fifo/handle_linux.go
generated
vendored
@ -15,6 +15,7 @@ const O_PATH = 010000000
|
|||||||
|
|
||||||
type handle struct {
|
type handle struct {
|
||||||
f *os.File
|
f *os.File
|
||||||
|
fd uintptr
|
||||||
dev uint64
|
dev uint64
|
||||||
ino uint64
|
ino uint64
|
||||||
closeOnce sync.Once
|
closeOnce sync.Once
|
||||||
@ -27,10 +28,13 @@ func getHandle(fn string) (*handle, error) {
|
|||||||
return nil, errors.Wrapf(err, "failed to open %v with O_PATH", fn)
|
return nil, errors.Wrapf(err, "failed to open %v with O_PATH", fn)
|
||||||
}
|
}
|
||||||
|
|
||||||
var stat syscall.Stat_t
|
var (
|
||||||
if err := syscall.Fstat(int(f.Fd()), &stat); err != nil {
|
stat syscall.Stat_t
|
||||||
|
fd = f.Fd()
|
||||||
|
)
|
||||||
|
if err := syscall.Fstat(int(fd), &stat); err != nil {
|
||||||
f.Close()
|
f.Close()
|
||||||
return nil, errors.Wrapf(err, "failed to stat handle %v", f.Fd())
|
return nil, errors.Wrapf(err, "failed to stat handle %v", fd)
|
||||||
}
|
}
|
||||||
|
|
||||||
h := &handle{
|
h := &handle{
|
||||||
@ -38,6 +42,7 @@ func getHandle(fn string) (*handle, error) {
|
|||||||
name: fn,
|
name: fn,
|
||||||
dev: uint64(stat.Dev),
|
dev: uint64(stat.Dev),
|
||||||
ino: stat.Ino,
|
ino: stat.Ino,
|
||||||
|
fd: fd,
|
||||||
}
|
}
|
||||||
|
|
||||||
// check /proc just in case
|
// check /proc just in case
|
||||||
@ -50,7 +55,7 @@ func getHandle(fn string) (*handle, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (h *handle) procPath() string {
|
func (h *handle) procPath() string {
|
||||||
return fmt.Sprintf("/proc/self/fd/%d", h.f.Fd())
|
return fmt.Sprintf("/proc/self/fd/%d", h.fd)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *handle) Name() string {
|
func (h *handle) Name() string {
|
||||||
|
Loading…
Reference in New Issue
Block a user