Update wait calls to call Wait on Command
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
parent
eb075733c5
commit
c8a8176936
2 changed files with 4 additions and 6 deletions
|
@ -56,7 +56,7 @@ func Exec(container *libcontainer.Container, term Terminal, rootfs, dataPath str
|
|||
}
|
||||
if err := WritePid(dataPath, command.Process.Pid, started); err != nil {
|
||||
command.Process.Kill()
|
||||
command.Process.Wait()
|
||||
command.Wait()
|
||||
return -1, err
|
||||
}
|
||||
defer DeletePid(dataPath)
|
||||
|
@ -66,7 +66,7 @@ func Exec(container *libcontainer.Container, term Terminal, rootfs, dataPath str
|
|||
cleaner, err := SetupCgroups(container, command.Process.Pid)
|
||||
if err != nil {
|
||||
command.Process.Kill()
|
||||
command.Process.Wait()
|
||||
command.Wait()
|
||||
return -1, err
|
||||
}
|
||||
if cleaner != nil {
|
||||
|
@ -75,7 +75,7 @@ func Exec(container *libcontainer.Container, term Terminal, rootfs, dataPath str
|
|||
|
||||
if err := InitializeNetworking(container, command.Process.Pid, syncPipe); err != nil {
|
||||
command.Process.Kill()
|
||||
command.Process.Wait()
|
||||
command.Wait()
|
||||
return -1, err
|
||||
}
|
||||
|
||||
|
|
|
@ -126,9 +126,7 @@ func RestoreParentDeathSignal(old int) error {
|
|||
// Signal self if parent is already dead. Does nothing if running in a new
|
||||
// PID namespace, as Getppid will always return 0.
|
||||
if syscall.Getppid() == 1 {
|
||||
err := syscall.Kill(syscall.Getpid(), syscall.Signal(old))
|
||||
syscall.Wait4(syscall.Getpid(), nil, 0, nil)
|
||||
return err
|
||||
return syscall.Kill(syscall.Getpid(), syscall.SIGKILL)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Reference in a new issue