Merge pull request #8169 from unclejack/avoid_attach_alloc

daemon/attach: avoid mem alloc for interface
This commit is contained in:
unclejack 2014-09-22 21:29:50 +03:00
Родитель 350b1cf6ea 950bfe4193
Коммит 06d0853682
1 изменённых файлов: 2 добавлений и 3 удалений

Просмотреть файл

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