mirror of
https://github.com/mumble-voip/grumble.git
synced 2025-12-20 06:10:00 -08:00
Update for Go 1.
This commit is contained in:
parent
4114a83d64
commit
e46a65109f
31 changed files with 901 additions and 202 deletions
|
|
@ -5,17 +5,18 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"exp/signal"
|
||||
"fmt"
|
||||
"grumble/logtarget"
|
||||
"github.com/mkrautz/grumble/pkg/logtarget"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func SignalHandler() {
|
||||
for {
|
||||
sig := <-signal.Incoming
|
||||
|
||||
if sig == os.SIGUSR2 {
|
||||
if sig == os.UnixSignal(syscall.SIGUSR2) {
|
||||
err := logtarget.Target.Rotate()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Unable to rotate log file: %v", err)
|
||||
|
|
@ -23,7 +24,7 @@ func SignalHandler() {
|
|||
continue
|
||||
}
|
||||
|
||||
if sig == os.SIGINT || sig == os.SIGTERM {
|
||||
if sig == os.UnixSignal(syscall.SIGINT) || sig == os.UnixSignal(syscall.SIGTERM) {
|
||||
os.Exit(0)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue