Browse Source

cmd/debug: execute p.Signal only when p is not nil (#4271)

* cmd/debug: execute p.Signal when p is not nil

https://github.com/tendermint/tendermint/pull/4266#discussion_r360015827

* replace else with else if
pull/4281/head
Anton Kaliaev 5 years ago
committed by GitHub
parent
commit
7d7b47a39a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      cmd/tendermint/commands/debug/kill.go

+ 1
- 2
cmd/tendermint/commands/debug/kill.go View File

@ -124,8 +124,7 @@ func killProc(pid uint64, dir string) error {
p, err := os.FindProcess(os.Getpid())
if err != nil {
fmt.Fprintf(os.Stderr, "failed to find PID to kill Tendermint process: %s", err)
}
if err = p.Signal(syscall.SIGABRT); err != nil {
} else if err = p.Signal(syscall.SIGABRT); err != nil {
fmt.Fprintf(os.Stderr, "failed to kill Tendermint process: %s", err)
}


Loading…
Cancel
Save