From 65bc696b0c9782f8270caacc6a92fbd2e78deed6 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Mon, 31 Jul 2017 17:43:37 -0600 Subject: [PATCH] Fix force quit using SIGINT Only the outside function call is executed in a new goroutine when invoking 'go'. Oops. Force quits (2 SIGINTs) now work again. --- sigtrap.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sigtrap.go b/sigtrap.go index a456434b..185631bd 100644 --- a/sigtrap.go +++ b/sigtrap.go @@ -42,7 +42,9 @@ func trapSignalsCrossPlatform() { os.Remove(PidFile) } - go os.Exit(executeShutdownCallbacks("SIGINT")) + go func() { + os.Exit(executeShutdownCallbacks("SIGINT")) + }() } }() }