mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
setFreezer: explicitly return nil
errors.Wrap(err, "some error") returns nil if err is nil, so it's slightly clearer to just return early than to set the error to nil and call errors.Wrap(). This is also somewhat defensive in case we decide to replace `errors.Wrap()` for golang's native `%w` wrapping. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -19,7 +19,7 @@ func setFreezer(dirPath string, state configs.FreezerState) error {
|
||||
// freeze the container (since without the freezer cgroup, that's a
|
||||
// no-op).
|
||||
if state == configs.Undefined || state == configs.Thawed {
|
||||
err = nil
|
||||
return nil
|
||||
}
|
||||
return errors.Wrap(err, "freezer not supported")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user