beam/examples/beamsh: don't print discarded messages in Devnull

This avoids false alarms when process exits without printing. Devnull
doesn't require synchronization.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: e512fef42505b3d276936a563a3ea4a44a52b19c
Component: engine
This commit is contained in:
Solomon Hykes
2014-03-26 15:47:05 -07:00
parent 90f7f3b975
commit 45c6418e21

View File

@ -87,11 +87,10 @@ func Devnull() (*net.UnixConn, error) {
go func() {
defer priv.Close()
for {
payload, attachment, err := beam.Receive(priv)
_, attachment, err := beam.Receive(priv)
if err != nil {
return
}
fmt.Fprintf(os.Stderr, "[devnull] discarding '%s'\n", data.Message(string(payload)).Pretty())
if attachment != nil {
attachment.Close()
}