Update for Go 1.

This commit is contained in:
Mikkel Krautz 2012-02-06 22:16:16 +01:00
parent 4114a83d64
commit e46a65109f
31 changed files with 901 additions and 202 deletions

View file

@ -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)
}
}