From 76e70fbe6ec8978c1cf36a966bca31c7417d5c67 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 18 Jan 2017 13:28:33 -0500 Subject: sd_daemon: Update a comment. --- sd_daemon/notify.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sd_daemon/notify.go b/sd_daemon/notify.go index 8b813cc..f2b9076 100644 --- a/sd_daemon/notify.go +++ b/sd_daemon/notify.go @@ -114,11 +114,15 @@ func Notify(pid int, unsetEnv bool, state string, files []*os.File) error { return err } -// socketUnixgram wraps socket(2), but doesn't bind(2) to anything. -// This is an ugly hack because none of the functions in "net" -// actually allow you to get a AF_UNIX socket not bound to anything (I -// think that sentence is still true if you take out "AF_UNIX", but -// I'm not totally certain of that). +// socketUnixgram wraps socket(2), but doesn't bind(2) or connect(2) +// the socket to anything. This is an ugly hack because none of the +// functions in "net" actually allow you to get a AF_UNIX socket not +// bound/connected to anything. +// +// At some point you begin to question if it is worth it to keep up +// the high-level interface of "net", and messing around with FileConn +// and UnixConn. Maybe we just drop to using unix.Socket and +// unix.SendmsgN directly. func socketUnixgram(name string) (*net.UnixConn, error) { fd, err := unix.Socket(unix.AF_UNIX, unix.SOCK_DGRAM|unix.SOCK_CLOEXEC, 0) if err != nil { -- cgit v1.1-4-g5e80