summaryrefslogtreecommitdiff
path: root/vendor/github.com/containerd/fifo/handle_nolinux.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/containerd/fifo/handle_nolinux.go')
-rw-r--r--vendor/github.com/containerd/fifo/handle_nolinux.go17
1 files changed, 8 insertions, 9 deletions
diff --git a/vendor/github.com/containerd/fifo/handle_nolinux.go b/vendor/github.com/containerd/fifo/handle_nolinux.go
index 4f2a282b2b..f6863cf32a 100644
--- a/vendor/github.com/containerd/fifo/handle_nolinux.go
+++ b/vendor/github.com/containerd/fifo/handle_nolinux.go
@@ -1,4 +1,4 @@
-// +build !linux
+//go:build !linux && !windows
/*
Copyright The containerd Authors.
@@ -19,9 +19,8 @@
package fifo
import (
+ "fmt"
"syscall"
-
- "github.com/pkg/errors"
)
type handle struct {
@@ -33,13 +32,13 @@ type handle struct {
func getHandle(fn string) (*handle, error) {
var stat syscall.Stat_t
if err := syscall.Stat(fn, &stat); err != nil {
- return nil, errors.Wrapf(err, "failed to stat %v", fn)
+ return nil, fmt.Errorf("failed to stat %v: %w", fn, err)
}
h := &handle{
fn: fn,
- dev: uint64(stat.Dev),
- ino: uint64(stat.Ino),
+ dev: uint64(stat.Dev), //nolint:unconvert,nolintlint
+ ino: uint64(stat.Ino), //nolint:unconvert,nolintlint
}
return h, nil
@@ -48,10 +47,10 @@ func getHandle(fn string) (*handle, error) {
func (h *handle) Path() (string, error) {
var stat syscall.Stat_t
if err := syscall.Stat(h.fn, &stat); err != nil {
- return "", errors.Wrapf(err, "path %v could not be statted", h.fn)
+ return "", fmt.Errorf("path %v could not be statted: %w", h.fn, err)
}
- if uint64(stat.Dev) != h.dev || uint64(stat.Ino) != h.ino {
- return "", errors.Errorf("failed to verify handle %v/%v %v/%v for %v", stat.Dev, h.dev, stat.Ino, h.ino, h.fn)
+ if uint64(stat.Dev) != h.dev || uint64(stat.Ino) != h.ino { //nolint:unconvert,nolintlint
+ return "", fmt.Errorf("failed to verify handle %v/%v %v/%v for %v", stat.Dev, h.dev, stat.Ino, h.ino, h.fn)
}
return h.fn, nil
}