diff --git a/goagain.go b/goagain.go index a69a2fd..0c02398 100644 --- a/goagain.go +++ b/goagain.go @@ -49,7 +49,7 @@ var ( Strategy strategy = Single ) -// Re-exec this same image without dropping the net.Listener. +// Exec: Re-exec this same image without dropping the net.Listener. func Exec(l net.Listener) error { var pid int fmt.Sscan(os.Getenv("GOAGAIN_PID"), &pid) @@ -73,7 +73,7 @@ func Exec(l net.Listener) error { return syscall.Exec(argv0, os.Args, os.Environ()) } -// Fork and exec this same image without dropping the net.Listener. +// ForkExec: Fork and exec this same image without dropping the net.Listener. func ForkExec(l net.Listener) error { argv0, err := lookPath() if nil != err { @@ -130,7 +130,7 @@ func ForkExec(l net.Listener) error { return nil } -// Test whether an error is equivalent to net.errClosing as returned by +// IsErrClosing tests whether an error is equivalent to net.errClosing as returned by // Accept during a graceful exit. func IsErrClosing(err error) bool { if opErr, ok := err.(*net.OpError); ok { @@ -163,7 +163,7 @@ func Kill() error { return syscall.Kill(pid, sig) } -// Reconstruct a net.Listener from a file descriptior and name specified in the +// Listener: Reconstruct a net.Listener from a file descriptior and name specified in the // environment. Deal with Go's insistence on dup(2)ing file descriptors. func Listener() (l net.Listener, err error) { var fd uintptr @@ -189,7 +189,7 @@ func Listener() (l net.Listener, err error) { return } -// Block this goroutine awaiting signals. Signals are handled as they +// Wait: Block this goroutine awaiting signals. Signals are handled as they // are by Nginx and Unicorn: . func Wait(l net.Listener) (syscall.Signal, error) { ch := make(chan os.Signal, 2) diff --git a/legacy.go b/legacy.go index f8299db..63418dc 100644 --- a/legacy.go +++ b/legacy.go @@ -7,14 +7,14 @@ import ( "syscall" ) -// Block this goroutine awaiting signals. Signals are handled as they +// AwaitSignals: Block this goroutine awaiting signals. Signals are handled as they // are by Nginx and Unicorn: . func AwaitSignals(l net.Listener) (err error) { _, err = Wait(l) return } -// Convert and validate the GOAGAIN_FD, GOAGAIN_NAME, and GOAGAIN_PPID +// GetEnvs: Convert and validate the GOAGAIN_FD, GOAGAIN_NAME, and GOAGAIN_PPID // environment variables. If all three are present and in order, this // is a child process that may pick up where the parent left off. func GetEnvs() (l net.Listener, ppid int, err error) { @@ -25,7 +25,7 @@ func GetEnvs() (l net.Listener, ppid int, err error) { return } -// Send SIGQUIT to the given ppid in order to complete the handoff to the +// KillParent: Send SIGQUIT to the given ppid in order to complete the handoff to the // child process. func KillParent(ppid int) error { return syscall.Kill(ppid, syscall.SIGQUIT)