2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-22 04:45:15 +00:00

Make all signal.Notify channels buffered

This commit is contained in:
greatroar 2020-03-12 19:55:46 +01:00
parent c542a509f0
commit 47d4d5bf1b
4 changed files with 5 additions and 6 deletions

View File

@ -20,7 +20,7 @@ var cleanupHandlers struct {
var stderr = os.Stderr
func init() {
cleanupHandlers.ch = make(chan os.Signal)
cleanupHandlers.ch = make(chan os.Signal, 1)
go CleanupHandler(cleanupHandlers.ch)
signal.Notify(cleanupHandlers.ch, syscall.SIGINT)
}

View File

@ -253,7 +253,7 @@ var ignoreSIGHUP sync.Once
func init() {
ignoreSIGHUP.Do(func() {
go func() {
c := make(chan os.Signal)
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGHUP)
for s := range c {
debug.Log("Signal received: %v\n", s)

View File

@ -11,7 +11,7 @@ import (
)
func init() {
c := make(chan os.Signal)
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGUSR1)
go func() {
for s := range c {

View File

@ -11,9 +11,8 @@ import (
)
func init() {
c := make(chan os.Signal)
signal.Notify(c, syscall.SIGUSR1)
signal.Notify(c, syscall.SIGINFO)
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGINFO, syscall.SIGUSR1)
go func() {
for s := range c {
debug.Log("Signal received: %v\n", s)