From 838b6040ae9894c876a9671b685e0988cf1d5ab9 Mon Sep 17 00:00:00 2001 From: Friedl Ulrich Date: Sat, 7 Feb 2015 10:08:20 +0100 Subject: [PATCH] SIGINT handling fix --- rfm69d/rfm69d.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/rfm69d/rfm69d.go b/rfm69d/rfm69d.go index 5d9eaa5..1c89d85 100644 --- a/rfm69d/rfm69d.go +++ b/rfm69d/rfm69d.go @@ -49,11 +49,15 @@ func main() { quit := rfm.Loop() - sigint := make(chan os.Signal) + sigint := make(chan os.Signal, 1) signal.Notify(sigint, os.Interrupt) - <-sigint - - quit <- 1 - <-quit + for { + select { + case <-sigint: + quit <- 1 + <-quit + return + } + } }