mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Do not mask *exec.ExitError
Fix #11764 Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
parent
5a1e5cf8c9
commit
f468bbb7e8
1 changed files with 6 additions and 7 deletions
|
@ -169,11 +169,11 @@ func (d *driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, startCallba
|
|||
}
|
||||
ps, err := waitF()
|
||||
if err != nil {
|
||||
if err, ok := err.(*exec.ExitError); !ok {
|
||||
execErr, ok := err.(*exec.ExitError)
|
||||
if !ok {
|
||||
return execdriver.ExitStatus{ExitCode: -1}, err
|
||||
} else {
|
||||
ps = err.ProcessState
|
||||
}
|
||||
ps = execErr.ProcessState
|
||||
}
|
||||
cont.Destroy()
|
||||
|
||||
|
@ -194,13 +194,12 @@ func waitInPIDHost(p *libcontainer.Process, c libcontainer.Container) func() (*o
|
|||
process, err := os.FindProcess(pid)
|
||||
s, err := process.Wait()
|
||||
if err != nil {
|
||||
if err, ok := err.(*exec.ExitError); !ok {
|
||||
execErr, ok := err.(*exec.ExitError)
|
||||
if !ok {
|
||||
return s, err
|
||||
} else {
|
||||
s = err.ProcessState
|
||||
}
|
||||
s = execErr.ProcessState
|
||||
}
|
||||
processes, err := c.Processes()
|
||||
if err != nil {
|
||||
return s, err
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue