|
@@ -127,7 +127,7 @@ func (daemon *Daemon) Attach(container *Container, stdin io.ReadCloser, stdinClo
|
|
)
|
|
)
|
|
|
|
|
|
if stdin != nil && container.Config.OpenStdin {
|
|
if stdin != nil && container.Config.OpenStdin {
|
|
- nJobs += 1
|
|
|
|
|
|
+ nJobs++
|
|
if cStdin, err := container.StdinPipe(); err != nil {
|
|
if cStdin, err := container.StdinPipe(); err != nil {
|
|
errors <- err
|
|
errors <- err
|
|
} else {
|
|
} else {
|
|
@@ -163,7 +163,7 @@ func (daemon *Daemon) Attach(container *Container, stdin io.ReadCloser, stdinClo
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if stdout != nil {
|
|
if stdout != nil {
|
|
- nJobs += 1
|
|
|
|
|
|
+ nJobs++
|
|
if p, err := container.StdoutPipe(); err != nil {
|
|
if p, err := container.StdoutPipe(); err != nil {
|
|
errors <- err
|
|
errors <- err
|
|
} else {
|
|
} else {
|
|
@@ -201,7 +201,7 @@ func (daemon *Daemon) Attach(container *Container, stdin io.ReadCloser, stdinClo
|
|
}()
|
|
}()
|
|
}
|
|
}
|
|
if stderr != nil {
|
|
if stderr != nil {
|
|
- nJobs += 1
|
|
|
|
|
|
+ nJobs++
|
|
if p, err := container.StderrPipe(); err != nil {
|
|
if p, err := container.StderrPipe(); err != nil {
|
|
errors <- err
|
|
errors <- err
|
|
} else {
|
|
} else {
|
|
@@ -252,7 +252,7 @@ func (daemon *Daemon) Attach(container *Container, stdin io.ReadCloser, stdinClo
|
|
|
|
|
|
// FIXME: how to clean up the stdin goroutine without the unwanted side effect
|
|
// FIXME: how to clean up the stdin goroutine without the unwanted side effect
|
|
// of closing the passed stdin? Add an intermediary io.Pipe?
|
|
// of closing the passed stdin? Add an intermediary io.Pipe?
|
|
- for i := 0; i < nJobs; i += 1 {
|
|
|
|
|
|
+ for i := 0; i < nJobs; i++ {
|
|
log.Debugf("attach: waiting for job %d/%d", i+1, nJobs)
|
|
log.Debugf("attach: waiting for job %d/%d", i+1, nJobs)
|
|
if err := <-errors; err != nil {
|
|
if err := <-errors; err != nil {
|
|
log.Errorf("attach: job %d returned error %s, aborting all jobs", i+1, err)
|
|
log.Errorf("attach: job %d returned error %s, aborting all jobs", i+1, err)
|