process_windows.go 498 B

123456789101112131415161718192021222324252627
  1. package libcontainerd
  2. import (
  3. "io"
  4. )
  5. // process keeps the state for both main container process and exec process.
  6. type process struct {
  7. processCommon
  8. // Platform specific fields are below here.
  9. // commandLine is to support returning summary information for docker top
  10. commandLine string
  11. }
  12. func openReaderFromPipe(p io.ReadCloser) io.Reader {
  13. r, w := io.Pipe()
  14. go func() {
  15. if _, err := io.Copy(w, p); err != nil {
  16. r.CloseWithError(err)
  17. }
  18. w.Close()
  19. p.Close()
  20. }()
  21. return r
  22. }