Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions goagain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand All @@ -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: <http://unicorn.bogomips.org/SIGNALS.html>.
func Wait(l net.Listener) (syscall.Signal, error) {
ch := make(chan os.Signal, 2)
Expand Down
6 changes: 3 additions & 3 deletions legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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: <http://unicorn.bogomips.org/SIGNALS.html>.
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) {
Expand All @@ -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)
Expand Down