summaryrefslogtreecommitdiff
path: root/daemon/attach.go
diff options
context:
space:
mode:
authorJim Minter <jminter@redhat.com>2017-03-15 11:33:04 +0000
committerJim Minter <jminter@redhat.com>2017-04-20 12:27:50 +0100
commit32ca1214fa55f55c54a54061ecf752b75f2c72c3 (patch)
treebe9aa78c63535d0b39bdf34168abcf9efa4869cd /daemon/attach.go
parent7936a962dc5f0f97fa2195c9497bc6e21e13fc2e (diff)
downloaddocker-32ca1214fa55f55c54a54061ecf752b75f2c72c3.tar.gz
Fix race on ContainerAttachRaw
Signed-off-by: Jim Minter <jminter@redhat.com>
Diffstat (limited to 'daemon/attach.go')
-rw-r--r--daemon/attach.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/daemon/attach.go b/daemon/attach.go
index fb213132f8..a0e2b700ae 100644
--- a/daemon/attach.go
+++ b/daemon/attach.go
@@ -73,7 +73,7 @@ func (daemon *Daemon) ContainerAttach(prefixOrName string, c *backend.ContainerA
}
// ContainerAttachRaw attaches the provided streams to the container's stdio
-func (daemon *Daemon) ContainerAttachRaw(prefixOrName string, stdin io.ReadCloser, stdout, stderr io.Writer, doStream bool) error {
+func (daemon *Daemon) ContainerAttachRaw(prefixOrName string, stdin io.ReadCloser, stdout, stderr io.Writer, doStream bool, attached chan struct{}) error {
container, err := daemon.GetContainer(prefixOrName)
if err != nil {
return err
@@ -86,6 +86,7 @@ func (daemon *Daemon) ContainerAttachRaw(prefixOrName string, stdin io.ReadClose
CloseStdin: container.Config.StdinOnce,
}
container.StreamConfig.AttachStreams(&cfg)
+ close(attached)
if cfg.UseStdin {
cfg.Stdin = stdin
}