Merge pull request #106 from ooni/signal-windows

Explicitly handle SIGINT
This commit is contained in:
Arturo Filastò 2020-02-10 17:38:17 +01:00 committed by GitHub
commit f8a49c972d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,7 +23,7 @@ import (
// flag, probably as part of: https://github.com/ooni/probe-cli/issues/45 // flag, probably as part of: https://github.com/ooni/probe-cli/issues/45
func listenForSignals(ctx *ooni.Context) { func listenForSignals(ctx *ooni.Context) {
s := make(chan os.Signal, 1) s := make(chan os.Signal, 1)
signal.Notify(s, os.Interrupt, syscall.SIGTERM) signal.Notify(s, os.Interrupt, syscall.SIGINT, syscall.SIGTERM)
go func() { go func() {
<-s <-s