File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -158,7 +158,32 @@ func (p *process) Wait() {
158
158
if err != nil {
159
159
p .log .Error ().Err (err ).Msgf ("Wait on %d failed" , proc .Pid )
160
160
} else if ps .ExitCode () != 0 {
161
- p .log .Info ().Int ("exitcode" , ps .ExitCode ()).Msgf ("Wait on %d returned" , proc .Pid )
161
+ if ws , ok := ps .Sys ().(syscall.WaitStatus ); ok {
162
+ l := p .log .Info ()
163
+ if ws .Exited () {
164
+ l = l .Int ("exit-status" , ws .ExitStatus ())
165
+ }
166
+
167
+ if ws .Stopped () {
168
+ l = l .Str ("stop-signal" , ws .StopSignal ().String ())
169
+ }
170
+
171
+ if ws .Signaled () {
172
+ l = l .Str ("signal" , ws .Signal ().String ())
173
+ }
174
+
175
+ if ws .Continued () {
176
+ l = l .Bool ("continued" , true )
177
+ }
178
+
179
+ if ws .CoreDump () {
180
+ l = l .Bool ("core-dump" , true )
181
+ }
182
+
183
+ l .Int ("trap-cause" , ws .TrapCause ()).Msgf ("Wait on %d returned" , proc .Pid )
184
+ } else {
185
+ p .log .Info ().Int ("exitcode" , ps .ExitCode ()).Msgf ("Wait on %d returned" , proc .Pid )
186
+ }
162
187
}
163
188
} else {
164
189
// Cannot wait on non-child process, so let's do it the hard way
You can’t perform that action at this time.
0 commit comments