mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-14 02:57:52 +08:00
f7cb556d9b
- Run "go fix" to remove legacy build tags - Use staticcheck@master until it has a release that supports Go 1.18 - Turn off autocrlf for Windows tasks
23 lines
313 B
Go
23 lines
313 B
Go
//go:build !windows && !plan9
|
|
|
|
package shell
|
|
|
|
import (
|
|
"fmt"
|
|
"io"
|
|
"os"
|
|
"syscall"
|
|
|
|
"src.elv.sh/pkg/sys"
|
|
)
|
|
|
|
func handleSignal(sig os.Signal, stderr io.Writer) {
|
|
switch sig {
|
|
case syscall.SIGHUP:
|
|
syscall.Kill(0, syscall.SIGHUP)
|
|
os.Exit(0)
|
|
case syscall.SIGUSR1:
|
|
fmt.Fprint(stderr, sys.DumpStack())
|
|
}
|
|
}
|