Return actual ProcessState on Wait error

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
Alexander Morozov 2015-02-25 11:45:53 -08:00
parent 286fffa4ee
commit d1f0d5705d
1 changed files with 2 additions and 2 deletions

View File

@ -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 {