libct.isPaused: use errors.Unwrap

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin 2020-03-31 20:01:20 -07:00
parent 272c83e169
commit 12e156f076
1 changed files with 1 additions and 4 deletions

View File

@ -1837,10 +1837,7 @@ func (c *linuxContainer) isPaused() (bool, error) {
data, err := ioutil.ReadFile(filepath.Join(fcg, filename))
if err != nil {
// If freezer cgroup is not mounted, the container would just be not paused.
if os.IsNotExist(err) {
return false, nil
}
if pathError, isPathError := err.(*os.PathError); isPathError && pathError.Err == syscall.ENODEV {
if os.IsNotExist(err) || errors.Unwrap(err) == syscall.ENODEV {
return false, nil
}
return false, newSystemErrorWithCause(err, "checking if container is paused")