Cleanup stdio files upon start and exec termination (ctr).

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure 2016-05-02 13:59:40 -07:00
parent c0a78ae10d
commit 5a688c3e28

View file

@ -164,6 +164,11 @@ var startCommand = cli.Command{
fatal(fmt.Sprintf("cannot get the absolute path of the bundle: %v", err), 1) fatal(fmt.Sprintf("cannot get the absolute path of the bundle: %v", err), 1)
} }
s, err := createStdio() s, err := createStdio()
defer func() {
if s.stdin != "" {
os.RemoveAll(filepath.Dir(s.stdin))
}
}()
if err != nil { if err != nil {
fatal(err.Error(), 1) fatal(err.Error(), 1)
} }
@ -463,6 +468,11 @@ var execCommand = cli.Command{
}, },
} }
s, err := createStdio() s, err := createStdio()
defer func() {
if s.stdin != "" {
os.RemoveAll(filepath.Dir(s.stdin))
}
}()
if err != nil { if err != nil {
fatal(err.Error(), 1) fatal(err.Error(), 1)
} }