SIGINT handling fix
This commit is contained in:
parent
e74117af27
commit
838b6040ae
1 changed files with 9 additions and 5 deletions
|
@ -49,11 +49,15 @@ func main() {
|
||||||
|
|
||||||
quit := rfm.Loop()
|
quit := rfm.Loop()
|
||||||
|
|
||||||
sigint := make(chan os.Signal)
|
sigint := make(chan os.Signal, 1)
|
||||||
signal.Notify(sigint, os.Interrupt)
|
signal.Notify(sigint, os.Interrupt)
|
||||||
|
|
||||||
<-sigint
|
for {
|
||||||
|
select {
|
||||||
|
case <-sigint:
|
||||||
quit <- 1
|
quit <- 1
|
||||||
<-quit
|
<-quit
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue