File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -145,18 +145,16 @@ func restart(builder Builder, runner Runner) error {
145145}
146146
147147func handleProgramExit (builder Builder , runner Runner , err error , noRestartOn string ) error {
148- exiterr , ok := err .(* exec.ExitError )
149- if ! ok {
150- return fmt .Errorf ("couldn't handle program crash restart: %v" , err )
151- }
148+ var exitStatus int
149+ if exiterr , ok := err .(* exec.ExitError ); ok {
150+ status , oks := exiterr .Sys ().(syscall.WaitStatus )
151+ if ! oks {
152+ return fmt .Errorf ("couldn't resolve exit status: %v" , err )
153+ }
152154
153- status , oks := exiterr .Sys ().(syscall.WaitStatus )
154- if ! oks {
155- return fmt .Errorf ("couldn't resolve exit status: %v" , err )
155+ exitStatus = status .ExitStatus ()
156156 }
157157
158- exitStatus := status .ExitStatus ()
159-
160158 // if "error", an exit code of 0 will still restart.
161159 if noRestartOn == "error" && exitStatus == exitStatusError {
162160 return nil
You can’t perform that action at this time.
0 commit comments