Skip to content

Commit

Permalink
Update proc_parent.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Md Sulaiman authored Oct 2, 2023
1 parent 00be397 commit 6e59471
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions proc_parent.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"path/filepath"
"runtime"
"strconv"
"strings"
"sync"
"syscall"
"time"
Expand Down Expand Up @@ -393,11 +394,13 @@ func (mp *parent) fork() error {
//proxy exit code out to parent
code := 0
if err != nil {
mp.warnf("prog returned error: %s", err)
if !strings.HasPrefix(err.Error(), "exit status") {
mp.warnf("prog returned error: %s", err)
}
code = 1
if exiterr, ok := err.(*exec.ExitError); ok {
if len(exiterr.Stderr) > 0 {
mp.warnf("prog stderr: %s", string(exiterr.Stderr))
mp.debugf("prog stderr: %s", string(exiterr.Stderr))
}
if status, ok := exiterr.Sys().(syscall.WaitStatus); ok {
code = status.ExitStatus()
Expand Down

0 comments on commit 6e59471

Please sign in to comment.