From 3b1bdfbd2687e81bef85260f9cdfbf617ece3527 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 18 Dec 2016 03:20:47 -0500 Subject: Implement almost all of sd-daemon. BREAKING CHANGES. This does not include the sd_is_* utility functions. BREAKING CHANGES: - The import name is now "sd_daemon" instead of "sd". - The logger interface is now entirely different. - Notify now takes more arguments. --- sd_daemon/listen_fds.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'sd_daemon/listen_fds.go') 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 */ -//#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) { -- cgit v1.2.3