mirror of
https://git.zx2c4.com/wireguard-go
synced 2025-10-24 00:43:06 +08:00
main_windows: Catch more exit events
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
"git.zx2c4.com/wireguard-go/tun"
|
"git.zx2c4.com/wireguard-go/tun"
|
||||||
)
|
)
|
||||||
@@ -71,6 +72,8 @@ func main() {
|
|||||||
// wait for program to terminate
|
// wait for program to terminate
|
||||||
|
|
||||||
signal.Notify(term, os.Interrupt)
|
signal.Notify(term, os.Interrupt)
|
||||||
|
signal.Notify(term, os.Kill)
|
||||||
|
signal.Notify(term, syscall.SIGTERM)
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case <-term:
|
case <-term:
|
||||||
|
Reference in New Issue
Block a user