ExitCode returns the exit code of the exited process, or -1 if the process hasn't exited or was terminated by a signal.
()
| 132 | // ExitCode returns the exit code of the exited process, or -1 |
| 133 | // if the process hasn't exited or was terminated by a signal. |
| 134 | func (p *ProcessState) ExitCode() int { |
| 135 | // return -1 if the process hasn't started. |
| 136 | if p == nil { |
| 137 | return -1 |
| 138 | } |
| 139 | return p.status.ExitStatus() |
| 140 | } |