1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Use ++ instead of += 1

Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
This commit is contained in:
Alexandr Morozov 2014-08-20 16:09:54 +04:00
parent a05d8d4f4f
commit 1ba15b8aca
2 changed files with 5 additions and 5 deletions

View file

@ -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)

View file

@ -908,7 +908,7 @@ func (b *buildFile) Build(context io.Reader) (string, error) {
} else if b.rm { } else if b.rm {
b.clearTmp(b.tmpContainers) b.clearTmp(b.tmpContainers)
} }
stepN += 1 stepN++
} }
if b.image != "" { if b.image != "" {
fmt.Fprintf(b.outStream, "Successfully built %s\n", utils.TruncateID(b.image)) fmt.Fprintf(b.outStream, "Successfully built %s\n", utils.TruncateID(b.image))