Browse Source

Ignore ErrClosedPipe for stdin in Container.Attach.

But pass `err` in the error channel anyway; don't ignore it anymore.
Jérôme Petazzoni 11 năm trước cách đây
mục cha
commit
b9eb5e04ae
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 4 2
      container.go

+ 4 - 2
container.go

@@ -470,11 +470,13 @@ func (container *Container) Attach(stdin io.ReadCloser, stdinCloser io.Closer, s
 				} else {
 					_, err = io.Copy(cStdin, stdin)
 				}
+				if err == io.ErrClosedPipe {
+					err = nil
+				}
 				if err != nil {
 					utils.Errorf("attach: stdin: %s", err)
 				}
-				// Discard error, expecting pipe error
-				errors <- nil
+				errors <- err
 			}()
 		}
 	}