Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
vc: Remove extra call to Kill
Browse files Browse the repository at this point in the history
Fixes #2207

Signed-off-by: Ted Yu <[email protected]>
  • Loading branch information
yutedz committed Nov 18, 2019
1 parent 547d580 commit ee9a53c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions virtcontainers/clh.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,14 +508,11 @@ func (clh *cloudHypervisor) terminate() (err error) {
}
clh.Logger().WithField("PID", pid).Info("Stopping Cloud Hypervisor")

// Check if VM process is running, in case it is not, let's
// return from here.
if err = syscall.Kill(pid, syscall.Signal(0)); err != nil {
return nil
}

// Send a SIGTERM to the VM process to try to stop it properly
if err = syscall.Kill(pid, syscall.SIGTERM); err != nil {
if err == syscall.ESRCH {
return nil
}
return err
}

Expand Down

0 comments on commit ee9a53c

Please sign in to comment.