ExitStatus returns the correct exit status for a process based on if it was signaled or exited cleanly
(status unix.WaitStatus)
| 16 | // ExitStatus returns the correct exit status for a process based on if it |
| 17 | // was signaled or exited cleanly |
| 18 | func ExitStatus(status unix.WaitStatus) int { |
| 19 | if status.Signaled() { |
| 20 | return exitSignalOffset + int(status.Signal()) |
| 21 | } |
| 22 | return status.ExitStatus() |
| 23 | } |
| 24 | |
| 25 | // WriteJSON writes the provided struct v to w using standard json marshaling |
| 26 | // without a trailing newline. This is used instead of json.Encoder because |
searching dependent graphs…