aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/fscommon.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-06-25 10:02:34 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2021-06-29 15:58:32 -0400
commit05f39af5bd716ce8d02a41e5c0aa1a2d632dab07 (patch)
treee9d2d0c43f3aa65dae28d71950b2824bd091b2be /vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/fscommon.go
parent793063e086d2a7fe15833be5456af95bc9b6ba24 (diff)
downloadpodman-05f39af5bd716ce8d02a41e5c0aa1a2d632dab07.tar.gz
podman-05f39af5bd716ce8d02a41e5c0aa1a2d632dab07.tar.bz2
podman-05f39af5bd716ce8d02a41e5c0aa1a2d632dab07.zip
Bump github.com/containers/storage from 1.32.3 to 1.32.5
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.32.3 to 1.32.5. - [Release notes](https://github.com/containers/storage/releases) - [Changelog](https://github.com/containers/storage/blob/main/docs/containers-storage-changes.md) - [Commits](https://github.com/containers/storage/compare/v1.32.3...v1.32.5) --- updated-dependencies: - dependency-name: github.com/containers/storage dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/fscommon.go')
-rw-r--r--vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/fscommon.go51
1 files changed, 0 insertions, 51 deletions
diff --git a/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/fscommon.go b/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/fscommon.go
deleted file mode 100644
index ae2613cdb..000000000
--- a/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/fscommon.go
+++ /dev/null
@@ -1,51 +0,0 @@
-// +build linux
-
-package fscommon
-
-import (
- "bytes"
- "os"
-
- "github.com/pkg/errors"
- "github.com/sirupsen/logrus"
- "golang.org/x/sys/unix"
-)
-
-// WriteFile writes data to a cgroup file in dir.
-// It is supposed to be used for cgroup files only.
-func WriteFile(dir, file, data string) error {
- fd, err := OpenFile(dir, file, unix.O_WRONLY)
- if err != nil {
- return err
- }
- defer fd.Close()
- if err := retryingWriteFile(fd, data); err != nil {
- return errors.Wrapf(err, "failed to write %q", data)
- }
- return nil
-}
-
-// ReadFile reads data from a cgroup file in dir.
-// It is supposed to be used for cgroup files only.
-func ReadFile(dir, file string) (string, error) {
- fd, err := OpenFile(dir, file, unix.O_RDONLY)
- if err != nil {
- return "", err
- }
- defer fd.Close()
- var buf bytes.Buffer
-
- _, err = buf.ReadFrom(fd)
- return buf.String(), err
-}
-
-func retryingWriteFile(fd *os.File, data string) error {
- for {
- _, err := fd.Write([]byte(data))
- if errors.Is(err, unix.EINTR) {
- logrus.Infof("interrupted while writing %s to %s", data, fd.Name())
- continue
- }
- return err
- }
-}