mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-07 12:30:45 +00:00
cmn: Kill
This commit is contained in:
@@ -50,6 +50,12 @@ func TrapSignal(cb func()) {
|
||||
select {}
|
||||
}
|
||||
|
||||
// Kill the running process by sending itself SIGTERM
|
||||
func Kill() error {
|
||||
pid := os.Getpid()
|
||||
return syscall.Kill(pid, syscall.SIGTERM)
|
||||
}
|
||||
|
||||
func Exit(s string) {
|
||||
fmt.Printf(s + "\n")
|
||||
os.Exit(1)
|
||||
|
||||
Reference in New Issue
Block a user