Files
go-i2p/lib/util/signals/windows.go
2017-08-27 10:48:34 -04:00

29 lines
296 B
Go

// +build windows
package signals
import (
"os"
"os/signal"
)
func init() {
signal.Notify(sigChan, os.Interrupt)
}
func Handle() {
for {
sig, ok := <-sigChan
if !ok {
// closed channel
return
}
if sig == os.Interrupt {
handleInterrupted()
} else {
// wtf?
}
}
}