Skip to content

Commit 4f97ab3

Browse files
authored
Merge pull request coreos#250 from vincentbernat/fix/close-listener
activation: close files after creating listeners
2 parents 1276583 + 4e7a0c4 commit 4f97ab3

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

activation/listeners.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ func Listeners(unsetEnv bool) ([]net.Listener, error) {
3232
for i, f := range files {
3333
if pc, err := net.FileListener(f); err == nil {
3434
listeners[i] = pc
35+
if unsetEnv {
36+
f.Close()
37+
}
3538
}
3639
}
3740
return listeners, nil

activation/packetconns.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ func PacketConns(unsetEnv bool) ([]net.PacketConn, error) {
3131
for i, f := range files {
3232
if pc, err := net.FilePacketConn(f); err == nil {
3333
conns[i] = pc
34+
if unsetEnv {
35+
f.Close()
36+
}
3437
}
3538
}
3639
return conns, nil

0 commit comments

Comments
 (0)