aboutsummaryrefslogtreecommitdiff
path: root/go/weed/signal_handling.go
diff options
context:
space:
mode:
Diffstat (limited to 'go/weed/signal_handling.go')
-rw-r--r--go/weed/signal_handling.go31
1 files changed, 0 insertions, 31 deletions
diff --git a/go/weed/signal_handling.go b/go/weed/signal_handling.go
deleted file mode 100644
index a8f166382..000000000
--- a/go/weed/signal_handling.go
+++ /dev/null
@@ -1,31 +0,0 @@
-// +build !plan9
-
-package main
-
-import (
- "os"
- "os/signal"
- "syscall"
-)
-
-func OnInterrupt(fn func()) {
- // deal with control+c,etc
- signalChan := make(chan os.Signal, 1)
- // controlling terminal close, daemon not exit
- signal.Ignore(syscall.SIGHUP)
- signal.Notify(signalChan,
- os.Interrupt,
- os.Kill,
- syscall.SIGALRM,
- // syscall.SIGHUP,
- syscall.SIGINT,
- syscall.SIGTERM,
- // syscall.SIGQUIT,
- )
- go func() {
- for _ = range signalChan {
- fn()
- os.Exit(0)
- }
- }()
-}