mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Ensure that the container dir is remove on restore
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
parent
fb08b8b221
commit
a115ce797b
1 changed files with 4 additions and 6 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue