File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -158,7 +158,24 @@ 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
+ l .Int ("trap-cause" , ws .TrapCause ()).Msgf ("Wait on %d returned" , proc .Pid )
176
+ } else {
177
+ p .log .Info ().Int ("exitcode" , ps .ExitCode ()).Msgf ("Wait on %d returned" , proc .Pid )
178
+ }
162
179
}
163
180
} else {
164
181
// 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