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.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/sd_daemon/listen_fds.go b/sd_daemon/listen_fds.go
index 434f7cc..f512384 100644
--- a/sd_daemon/listen_fds.go
+++ b/sd_daemon/listen_fds.go
@@ -13,7 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package sd
+package sd_daemon
import (
"os"
@@ -22,14 +22,10 @@ import (
"syscall"
)
-///*#include <systemd/sd-daemon.h>*/
-//#define SD_LISTEN_FDS_START 3
-import "C"
-
// 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
+// If unsetEnv is true, then (regardless of whether the function call
// itself succeeds or not) it will unset the environmental variables
// LISTEN_FDS and LISTEN_PID, which will cause further calls to this
// function to fail.
@@ -58,7 +54,7 @@ func ListenFds(unsetEnv bool) []*os.File {
files := make([]*os.File, 0, nfds)
for i := 0; i < nfds; i++ {
- fd := i+C.SD_LISTEN_FDS_START
+ fd := i+3
syscall.CloseOnExec(fd)
name := "unknown"
if i < len(names) {