Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make interrupt default exit with rc=1 and handle SIGHUP #23752

Merged
merged 1 commit into from
May 13, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/util/interrupt/interrupt.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func Chain(handler *Handler, notify ...func()) *Handler {

// New creates a new handler that guarantees all notify functions are run after the critical
// section exits (or is interrupted by the OS), then invokes the final handler. If no final
// handler is specified, the default final is `os.Exit(0)`. A handler can only be used for
// handler is specified, the default final is `os.Exit(1)`. A handler can only be used for
// one critical section.
func New(final func(os.Signal), notify ...func()) *Handler {
return &Handler{
Expand All @@ -76,7 +76,7 @@ func (h *Handler) Signal(s os.Signal) {
fn()
}
if h.final == nil {
os.Exit(0)
os.Exit(1)
}
h.final(s)
})
Expand Down