Close the inherited socket fd

containerd-shim has dup the fd 3, and it don't need fd 3 any more.

Signed-off-by: Shukui Yang <keloyangsk@gmail.com>
This commit is contained in:
Shukui Yang 2019-05-13 21:47:53 +08:00
parent 111b082e20
commit ec78305c49

View File

@ -196,7 +196,9 @@ func serve(ctx context.Context, server *ttrpc.Server, path string) error {
err error
)
if path == "" {
l, err = net.FileListener(os.NewFile(3, "socket"))
f := os.NewFile(3, "socket")
l, err = net.FileListener(f)
f.Close()
path = "[inherited from parent]"
} else {
if len(path) > 106 {