Use new cio package.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu
2018-01-12 22:35:24 +00:00
parent b07017b93e
commit cdb1bf0946
3 changed files with 10 additions and 30 deletions

View File

@@ -18,7 +18,6 @@ package io
import (
"io"
"os"
"sync"
"github.com/containerd/containerd/cio"
@@ -57,12 +56,7 @@ func NewExecIO(id, root string, tty, stdin bool) (*ExecIO, error) {
// Config returns io config.
func (e *ExecIO) Config() cio.Config {
return cio.Config{
Terminal: e.fifos.Terminal,
Stdin: e.fifos.In,
Stdout: e.fifos.Out,
Stderr: e.fifos.Err,
}
return e.fifos.Config
}
// Attach attaches exec stdio. The logic is similar with container io attach.
@@ -146,7 +140,7 @@ func (e *ExecIO) Close() error {
e.closer.Close()
}
if e.fifos != nil {
return os.RemoveAll(e.fifos.Dir)
return e.fifos.Close()
}
return nil
}