summaryrefslogtreecommitdiff
path: root/sd_daemon/listen_fds.go
diff options
context:
space:
mode:
Diffstat (limited to 'sd_daemon/listen_fds.go')
-rw-r--r--sd_daemon/listen_fds.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/sd_daemon/listen_fds.go b/sd_daemon/listen_fds.go
index 0ddf0d0..e6a81ca 100644
--- a/sd_daemon/listen_fds.go
+++ b/sd_daemon/listen_fds.go
@@ -25,8 +25,8 @@ import (
//#define SD_LISTEN_FDS_START 3
import "C"
-// Returns a list of file descriptors passed in by the service manager
-// as part of the socket-based activation logic.
+// ListenFds returns a list of file descriptors passed in by the
+// service manager as part of the socket-based activation logic.
//
// If unsetEnv is true, then (regarless of whether the function call
// itself succeeds or not) it will unset the environmental variables
@@ -36,8 +36,8 @@ import "C"
// In the case of an error, this function returns nil.
func ListenFds(unsetEnv bool) []*os.File {
if unsetEnv {
- defer os.Unsetenv("LISTEN_PID")
- defer os.Unsetenv("LISTEN_FDS")
+ defer func() { _ = os.Unsetenv("LISTEN_PID") }()
+ defer func() { _ = os.Unsetenv("LISTEN_FDS") }()
}
pid, err := strconv.Atoi(os.Getenv("LISTEN_PID"))