mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-27 07:48:55 +00:00
vc: Remove extra call to Kill
Fixes #2207 Signed-off-by: Ted Yu <yuzhihong@gmail.com>
This commit is contained in:
parent
547d580ad5
commit
ee9a53ca4b
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user