Ensure that the container dir is remove on restore
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael) Upstream-commit: a115ce797b80a14d268fcd96521cf05d1e1074c1 Component: engine
This commit is contained in:
@@ -108,20 +108,18 @@ func (d *driver) Kill(p *execdriver.Command, sig int) error {
|
||||
}
|
||||
|
||||
func (d *driver) Restore(c *execdriver.Command) error {
|
||||
var (
|
||||
nspid int
|
||||
path = filepath.Join(d.root, c.ID, "pid")
|
||||
)
|
||||
f, err := os.Open(path)
|
||||
var nspid int
|
||||
f, err := os.Open(filepath.Join(d.root, c.ID, "pid"))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer d.removeContainerRoot(c.ID)
|
||||
|
||||
if _, err := fmt.Fscanf(f, "%d", &nspid); err != nil {
|
||||
f.Close()
|
||||
return err
|
||||
}
|
||||
f.Close()
|
||||
defer os.Remove(path)
|
||||
|
||||
proc, err := os.FindProcess(nspid)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user