From a052b82c780cddb8765e2bb99c67d007ff37dc65 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Sat, 17 Dec 2022 21:15:55 -0800 Subject: [PATCH] don't reference SIGUSR1 on windows (#2018) --- irc/utils/signals.go | 3 +-- irc/utils/signals_plan9.go | 1 - irc/utils/signals_windows.go | 23 +++++++++++++++++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 irc/utils/signals_windows.go diff --git a/irc/utils/signals.go b/irc/utils/signals.go index 20f45301..4198c9a6 100644 --- a/irc/utils/signals.go +++ b/irc/utils/signals.go @@ -1,5 +1,4 @@ -//go:build !plan9 -// +build !plan9 +//go:build !plan9 && !windows // Copyright (c) 2020 Shivaram Lingamneni // released under the MIT license diff --git a/irc/utils/signals_plan9.go b/irc/utils/signals_plan9.go index 9e1968e9..81dcba2d 100644 --- a/irc/utils/signals_plan9.go +++ b/irc/utils/signals_plan9.go @@ -1,5 +1,4 @@ //go:build plan9 -// +build plan9 // Copyright (c) 2020 Shivaram Lingamneni // released under the MIT license diff --git a/irc/utils/signals_windows.go b/irc/utils/signals_windows.go new file mode 100644 index 00000000..1e8e8f64 --- /dev/null +++ b/irc/utils/signals_windows.go @@ -0,0 +1,23 @@ +//go:build windows + +// Copyright (c) 2020 Shivaram Lingamneni +// released under the MIT license + +package utils + +import ( + "os" + "syscall" +) + +var ( + // ServerExitSignals are the signals the server will exit on. + ServerExitSignals = []os.Signal{ + syscall.SIGINT, + syscall.SIGTERM, + syscall.SIGQUIT, + } + + // no SIGUSR1 on windows + ServerTracebackSignals []os.Signal +)