mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-13 09:57:51 +08:00
22 lines
302 B
Go
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())
|
|
}
|
|
}
|