elvish/pkg/shell/signal_unix.go
2021-01-27 01:30:25 +00:00

22 lines
302 B
Go

// +build !windows,!plan9
package shell
import (
"fmt"
"os"
"syscall"
"src.elv.sh/pkg/sys"
)
func handleSignal(sig os.Signal, stderr *os.File) {
switch sig {
case syscall.SIGHUP:
syscall.Kill(0, syscall.SIGHUP)
os.Exit(0)
case syscall.SIGUSR1:
fmt.Fprint(stderr, sys.DumpStack())
}
}