Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
ab4ffd3a
Commit
ab4ffd3a
authored
May 13, 2016
by
Jeff Lowdermilk
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #23752 from bparees/interrupt
make interrupt default exit with rc=1 and handle SIGHUP
parents
bb3f5b17
936650d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
interrupt.go
pkg/util/interrupt/interrupt.go
+2
-2
No files found.
pkg/util/interrupt/interrupt.go
View file @
ab4ffd3a
...
@@ -49,7 +49,7 @@ func Chain(handler *Handler, notify ...func()) *Handler {
...
@@ -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
// 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
// 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.
// one critical section.
func
New
(
final
func
(
os
.
Signal
),
notify
...
func
())
*
Handler
{
func
New
(
final
func
(
os
.
Signal
),
notify
...
func
())
*
Handler
{
return
&
Handler
{
return
&
Handler
{
...
@@ -76,7 +76,7 @@ func (h *Handler) Signal(s os.Signal) {
...
@@ -76,7 +76,7 @@ func (h *Handler) Signal(s os.Signal) {
fn
()
fn
()
}
}
if
h
.
final
==
nil
{
if
h
.
final
==
nil
{
os
.
Exit
(
0
)
os
.
Exit
(
1
)
}
}
h
.
final
(
s
)
h
.
final
(
s
)
})
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment