2016-03-18 14:53:27 -04:00
|
|
|
package libcontainerd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
)
|
|
|
|
|
|
|
|
// process keeps the state for both main container process and exec process.
|
|
|
|
type process struct {
|
|
|
|
processCommon
|
2016-03-18 23:29:27 -04:00
|
|
|
|
2016-03-20 18:58:23 -04:00
|
|
|
// Platform specific fields are below here.
|
|
|
|
|
|
|
|
// commandLine is to support returning summary information for docker top
|
|
|
|
commandLine string
|
2016-03-18 14:53:27 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
func openReaderFromPipe(p io.ReadCloser) io.Reader {
|
|
|
|
r, w := io.Pipe()
|
|
|
|
go func() {
|
|
|
|
if _, err := io.Copy(w, p); err != nil {
|
|
|
|
r.CloseWithError(err)
|
|
|
|
}
|
|
|
|
w.Close()
|
|
|
|
p.Close()
|
|
|
|
}()
|
|
|
|
return r
|
|
|
|
}
|