Check for cmd.Process not-nilness in setnsProcess.terminate()

We already doing this in initProcess

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
Alexander Morozov 2015-04-22 11:30:42 -07:00
parent bada39cf31
commit d7aab179c1
1 changed files with 3 additions and 0 deletions

View File

@ -119,6 +119,9 @@ func (p *setnsProcess) execSetns() error {
// terminate sends a SIGKILL to the forked process for the setns routine then waits to
// avoid the process becomming a zombie.
func (p *setnsProcess) terminate() error {
if p.cmd.Process == nil {
return nil
}
err := p.cmd.Process.Kill()
if _, werr := p.wait(); err == nil {
err = werr