build(deps): bump github.com/checkpoint-restore/go-criu/v7
Bumps [github.com/checkpoint-restore/go-criu/v7](https://github.com/checkpoint-restore/go-criu) from 7.1.0 to 7.2.0. - [Release notes](https://github.com/checkpoint-restore/go-criu/releases) - [Commits](https://github.com/checkpoint-restore/go-criu/compare/v7.1.0...v7.2.0) --- updated-dependencies: - dependency-name: github.com/checkpoint-restore/go-criu/v7 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
24
vendor/github.com/checkpoint-restore/go-criu/v7/main.go
generated
vendored
24
vendor/github.com/checkpoint-restore/go-criu/v7/main.go
generated
vendored
@@ -61,13 +61,19 @@ func (c *Criu) Prepare() error {
|
||||
}
|
||||
|
||||
// Cleanup cleans up
|
||||
func (c *Criu) Cleanup() {
|
||||
func (c *Criu) Cleanup() error {
|
||||
var errs []error
|
||||
if c.swrkCmd != nil {
|
||||
c.swrkSk.Close()
|
||||
if err := c.swrkSk.Close(); err != nil {
|
||||
errs = append(errs, err)
|
||||
}
|
||||
c.swrkSk = nil
|
||||
_ = c.swrkCmd.Wait()
|
||||
if err := c.swrkCmd.Wait(); err != nil {
|
||||
errs = append(errs, fmt.Errorf("criu swrk failed: %w", err))
|
||||
}
|
||||
c.swrkCmd = nil
|
||||
}
|
||||
return errors.Join(errs...)
|
||||
}
|
||||
|
||||
func (c *Criu) sendAndRecv(reqB []byte) ([]byte, int, error) {
|
||||
@@ -99,9 +105,7 @@ func (c *Criu) doSwrk(reqType rpc.CriuReqType, opts *rpc.CriuOpts, nfy Notify) e
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Criu) doSwrkWithResp(reqType rpc.CriuReqType, opts *rpc.CriuOpts, nfy Notify, features *rpc.CriuFeatures) (*rpc.CriuResp, error) {
|
||||
var resp *rpc.CriuResp
|
||||
|
||||
func (c *Criu) doSwrkWithResp(reqType rpc.CriuReqType, opts *rpc.CriuOpts, nfy Notify, features *rpc.CriuFeatures) (resp *rpc.CriuResp, retErr error) {
|
||||
req := rpc.CriuReq{
|
||||
Type: &reqType,
|
||||
Opts: opts,
|
||||
@@ -121,7 +125,13 @@ func (c *Criu) doSwrkWithResp(reqType rpc.CriuReqType, opts *rpc.CriuOpts, nfy N
|
||||
return nil, err
|
||||
}
|
||||
|
||||
defer c.Cleanup()
|
||||
defer func() {
|
||||
// append any cleanup errors to the returned error
|
||||
err := c.Cleanup()
|
||||
if err != nil {
|
||||
retErr = errors.Join(retErr, err)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
for {
|
||||
|
||||
Reference in New Issue
Block a user