Skip to content

Commit b95f0a6

Browse files
authored
Merge pull request #3359 from keloyang/close-socket-fd
Close the inherited socket fd
2 parents 111b082 + ec78305 commit b95f0a6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

cmd/containerd-shim/main_unix.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@ func serve(ctx context.Context, server *ttrpc.Server, path string) error {
196196
err error
197197
)
198198
if path == "" {
199-
l, err = net.FileListener(os.NewFile(3, "socket"))
199+
f := os.NewFile(3, "socket")
200+
l, err = net.FileListener(f)
201+
f.Close()
200202
path = "[inherited from parent]"
201203
} else {
202204
if len(path) > 106 {

0 commit comments

Comments
 (0)