Merge pull request #3359 from keloyang/close-socket-fd

Close the inherited socket fd
This commit is contained in:
Phil Estes 2019-06-20 18:12:25 +03:00 committed by GitHub
commit b95f0a6cea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 {