libct.isPaused: use errors.Unwrap
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
parent
272c83e169
commit
12e156f076
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue