go vet claims we need a buffered chan for signal
This commit is contained in:
parent
0faedcb9c5
commit
cb7c9d700b
3 changed files with 5 additions and 5 deletions
2
admin.go
2
admin.go
|
@ -125,7 +125,7 @@ func adminscreen() {
|
||||||
}
|
}
|
||||||
defer restore()
|
defer restore()
|
||||||
go func() {
|
go func() {
|
||||||
sig := make(chan os.Signal)
|
sig := make(chan os.Signal, 1)
|
||||||
signal.Notify(sig, os.Interrupt)
|
signal.Notify(sig, os.Interrupt)
|
||||||
<-sig
|
<-sig
|
||||||
restore()
|
restore()
|
||||||
|
|
6
util.go
6
util.go
|
@ -90,7 +90,7 @@ func initdb() {
|
||||||
os.Remove(dbname)
|
os.Remove(dbname)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}()
|
}()
|
||||||
c := make(chan os.Signal)
|
c := make(chan os.Signal, 1)
|
||||||
signal.Notify(c, os.Interrupt)
|
signal.Notify(c, os.Interrupt)
|
||||||
go func() {
|
go func() {
|
||||||
<-c
|
<-c
|
||||||
|
@ -209,7 +209,7 @@ func adduser() {
|
||||||
defer func() {
|
defer func() {
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}()
|
}()
|
||||||
c := make(chan os.Signal)
|
c := make(chan os.Signal, 1)
|
||||||
signal.Notify(c, os.Interrupt)
|
signal.Notify(c, os.Interrupt)
|
||||||
go func() {
|
go func() {
|
||||||
<-c
|
<-c
|
||||||
|
@ -263,7 +263,7 @@ func chpass(username string) {
|
||||||
defer func() {
|
defer func() {
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}()
|
}()
|
||||||
c := make(chan os.Signal)
|
c := make(chan os.Signal, 1)
|
||||||
signal.Notify(c, os.Interrupt)
|
signal.Notify(c, os.Interrupt)
|
||||||
go func() {
|
go func() {
|
||||||
<-c
|
<-c
|
||||||
|
|
2
web.go
2
web.go
|
@ -2567,7 +2567,7 @@ var readyalready = make(chan bool)
|
||||||
var workinprogress = 0
|
var workinprogress = 0
|
||||||
|
|
||||||
func enditall() {
|
func enditall() {
|
||||||
sig := make(chan os.Signal)
|
sig := make(chan os.Signal, 1)
|
||||||
signal.Notify(sig, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)
|
signal.Notify(sig, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)
|
||||||
<-sig
|
<-sig
|
||||||
ilog.Printf("stopping...")
|
ilog.Printf("stopping...")
|
||||||
|
|
Loading…
Reference in a new issue