Return actual ProcessState on Wait error
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
parent
286fffa4ee
commit
d1f0d5705d
|
@ -111,7 +111,7 @@ func (p *setnsProcess) terminate() error {
|
|||
func (p *setnsProcess) wait() (*os.ProcessState, error) {
|
||||
err := p.cmd.Wait()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return p.cmd.ProcessState, err
|
||||
}
|
||||
|
||||
return p.cmd.ProcessState, nil
|
||||
|
@ -172,7 +172,7 @@ func (p *initProcess) start() error {
|
|||
func (p *initProcess) wait() (*os.ProcessState, error) {
|
||||
err := p.cmd.Wait()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return p.cmd.ProcessState, err
|
||||
}
|
||||
// we should kill all processes in cgroup when init is died if we use host PID namespace
|
||||
if p.cmd.SysProcAttr.Cloneflags&syscall.CLONE_NEWPID == 0 {
|
||||
|
|
Loading…
Reference in New Issue