From 07c03944ffc5010ae0300bfd794c79f44e1637d4 Mon Sep 17 00:00:00 2001
From: Solomon Hykes <solomon@docker.com>
Date: Sun, 23 Mar 2014 20:42:29 -0700
Subject: [PATCH] Beam: don't close the attachment FD when closing superfluous
 FDs

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
---
 pkg/beam/unix.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkg/beam/unix.go b/pkg/beam/unix.go
index 42358dcd53..7dfff8a1ac 100644
--- a/pkg/beam/unix.go
+++ b/pkg/beam/unix.go
@@ -55,7 +55,7 @@ func Receive(conn *net.UnixConn) (rdata []byte, rf *os.File, rerr error) {
 		}
 		var f *os.File
 		if len(fds) > 1 {
-			for _, fd := range fds {
+			for _, fd := range fds[1:] {
 				syscall.Close(fd)
 			}
 		}