diff --git a/daemon/attach.go b/daemon/attach.go index b1b06e2765..13824ea842 100644 --- a/daemon/attach.go +++ b/daemon/attach.go @@ -127,7 +127,7 @@ func (daemon *Daemon) Attach(container *Container, stdin io.ReadCloser, stdinClo ) if stdin != nil && container.Config.OpenStdin { - nJobs += 1 + nJobs++ if cStdin, err := container.StdinPipe(); err != nil { errors <- err } else { @@ -163,7 +163,7 @@ func (daemon *Daemon) Attach(container *Container, stdin io.ReadCloser, stdinClo } } if stdout != nil { - nJobs += 1 + nJobs++ if p, err := container.StdoutPipe(); err != nil { errors <- err } else { @@ -201,7 +201,7 @@ func (daemon *Daemon) Attach(container *Container, stdin io.ReadCloser, stdinClo }() } if stderr != nil { - nJobs += 1 + nJobs++ if p, err := container.StderrPipe(); err != nil { errors <- err } 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 // 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) if err := <-errors; err != nil { log.Errorf("attach: job %d returned error %s, aborting all jobs", i+1, err) diff --git a/daemon/build.go b/daemon/build.go index a572dc2ec2..b90c2629d0 100644 --- a/daemon/build.go +++ b/daemon/build.go @@ -908,7 +908,7 @@ func (b *buildFile) Build(context io.Reader) (string, error) { } else if b.rm { b.clearTmp(b.tmpContainers) } - stepN += 1 + stepN++ } if b.image != "" { fmt.Fprintf(b.outStream, "Successfully built %s\n", utils.TruncateID(b.image))