Skip to content

Commit cc56790

Browse files
committed
socketactivation: close file with passed fd w/o CloseExec
1 parent ec4cb63 commit cc56790

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

varlink/socketactivation.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build !windows
1+
//go:build !windows
22

33
package varlink
44

@@ -7,7 +7,6 @@ import (
77
"os"
88
"strconv"
99
"strings"
10-
"syscall"
1110
)
1211

1312
func activationListener() net.Listener {
@@ -51,9 +50,9 @@ func activationListener() net.Listener {
5150
fd = 3
5251
}
5352

54-
syscall.CloseOnExec(fd)
55-
5653
file := os.NewFile(uintptr(fd), "varlink")
54+
defer file.Close()
55+
5756
listener, err := net.FileListener(file)
5857
if err != nil {
5958
return nil

0 commit comments

Comments
 (0)