Commit edcd803
committed
Handle signal-terminated processes in exit status
When a child process is terminated by a Unix signal (e.g., SIGKILL,
SIGTERM), $?.exitstatus returns nil. This caused downstream code to
break when comparing exit statuses.
Following Unix shell convention, signal terminations now return
128 + signal_number (e.g., 137 for SIGKILL, 143 for SIGTERM).
Falls back to exit status 1 if neither exitstatus nor termsig is
available.1 parent 40bc383 commit edcd803
2 files changed
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
114 | 123 | | |
115 | 124 | | |
116 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
564 | 564 | | |
565 | 565 | | |
566 | 566 | | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
567 | 574 | | |
568 | 575 | | |
569 | 576 | | |
| |||
0 commit comments