mirror of
https://github.com/containers/podman.git
synced 2025-07-03 17:27:18 +08:00
pkg/rootless: use fileutils.(Le|E)xists
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -7,6 +7,7 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
"github.com/containers/storage/pkg/fileutils"
|
||||||
"github.com/containers/storage/pkg/lockfile"
|
"github.com/containers/storage/pkg/lockfile"
|
||||||
"github.com/moby/sys/user"
|
"github.com/moby/sys/user"
|
||||||
spec "github.com/opencontainers/runtime-spec/specs-go"
|
spec "github.com/opencontainers/runtime-spec/specs-go"
|
||||||
@ -16,7 +17,7 @@ import (
|
|||||||
// TryJoinFromFilePaths. If joining fails, it attempts to delete the specified
|
// TryJoinFromFilePaths. If joining fails, it attempts to delete the specified
|
||||||
// file.
|
// file.
|
||||||
func TryJoinPauseProcess(pausePidPath string) (bool, int, error) {
|
func TryJoinPauseProcess(pausePidPath string) (bool, int, error) {
|
||||||
if _, err := os.Stat(pausePidPath); err != nil {
|
if err := fileutils.Exists(pausePidPath); err != nil {
|
||||||
if errors.Is(err, os.ErrNotExist) {
|
if errors.Is(err, os.ErrNotExist) {
|
||||||
return false, -1, nil
|
return false, -1, nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user