diff --git a/checkpoint.go b/checkpoint.go index afd515abd..50046fb93 100644 --- a/checkpoint.go +++ b/checkpoint.go @@ -70,7 +70,7 @@ checkpointed.`, } err = container.Checkpoint(options) - if err == nil && !(options.LeaveRunning || options.PreDump) { + if err == nil && !options.LeaveRunning && !options.PreDump { // Destroy the container unless we tell CRIU to keep it. if err := container.Destroy(); err != nil { logrus.Warn(err) diff --git a/libcontainer/criu_linux.go b/libcontainer/criu_linux.go index 468c5ba9f..30227289e 100644 --- a/libcontainer/criu_linux.go +++ b/libcontainer/criu_linux.go @@ -956,8 +956,8 @@ func (c *Container) criuSwrk(process *Process, req *criurpc.CriuReq, opts *CriuO // available but empty. criurpc.CriuReqType_VERSION actually // has no req.GetOpts(). if logrus.GetLevel() >= logrus.DebugLevel && - !(req.GetType() == criurpc.CriuReqType_FEATURE_CHECK || - req.GetType() == criurpc.CriuReqType_VERSION) { + (req.GetType() != criurpc.CriuReqType_FEATURE_CHECK && + req.GetType() != criurpc.CriuReqType_VERSION) { val := reflect.ValueOf(req.GetOpts()) v := reflect.Indirect(val) diff --git a/libcontainer/rootfs_linux.go b/libcontainer/rootfs_linux.go index c848fa773..b411b0f13 100644 --- a/libcontainer/rootfs_linux.go +++ b/libcontainer/rootfs_linux.go @@ -357,7 +357,7 @@ func mountCgroupV2(m *configs.Mount, c *mountConfig) error { err := utils.WithProcfd(c.root, m.Destination, func(dstFd string) error { return mountViaFds(m.Source, nil, m.Destination, dstFd, "cgroup2", uintptr(m.Flags), m.Data) }) - if err == nil || !(errors.Is(err, unix.EPERM) || errors.Is(err, unix.EBUSY)) { + if err == nil || (!errors.Is(err, unix.EPERM) && !errors.Is(err, unix.EBUSY)) { return err }