diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-12-18 03:20:47 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-12-18 03:20:47 -0500 |
commit | 3b1bdfbd2687e81bef85260f9cdfbf617ece3527 (patch) | |
tree | 93f2c45e6e616ab63e5fb21f4d2a740d8b9b05e2 /sd_daemon/listen_fds.go | |
parent | eb6e8a6ca87879a6ca85788fcf6d3bf8848088e6 (diff) |
Implement almost all of sd-daemon. BREAKING CHANGES.v0.2.0
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.
Diffstat (limited to 'sd_daemon/listen_fds.go')
-rw-r--r-- | sd_daemon/listen_fds.go | 10 |
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) { |