1
0
mirror of https://github.com/docker/cli.git synced 2026-01-15 07:40:57 +03:00

daemon/attach: avoid mem alloc for interface

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 950bfe419390bc0e5777ae70bd01f781ae61701a
Component: engine
This commit is contained in:
unclejack
2014-09-22 21:14:49 +03:00
parent 680ee7cfce
commit ab7d3fd292

View File

@@ -2,7 +2,6 @@ package daemon
import (
"encoding/json"
"fmt"
"io"
"os"
"time"
@@ -69,10 +68,10 @@ func (daemon *Daemon) ContainerAttach(job *engine.Job) engine.Status {
break
}
if l.Stream == "stdout" && stdout {
fmt.Fprintf(job.Stdout, "%s", l.Log)
io.WriteString(job.Stdout, l.Log)
}
if l.Stream == "stderr" && stderr {
fmt.Fprintf(job.Stderr, "%s", l.Log)
io.WriteString(job.Stderr, l.Log)
}
}
}