Skip to content

Commit

Permalink
Declare error name in output
Browse files Browse the repository at this point in the history
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
Co-authored-by: Signed-off-by: Adrian Cole <adrian@tetrate.io>
  • Loading branch information
dio and Signed-off-by: Adrian Cole committed Sep 9, 2021
1 parent 662c303 commit cef7467
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 2 additions & 3 deletions internal/moreos/proc_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ func isExecutable(f os.FileInfo) bool {
return f.Mode()&0111 != 0
}

func cmdStart(cmd *exec.Cmd, cancel context.CancelFunc, writeProcHint func()) error {
var err error
func cmdStart(cmd *exec.Cmd, cancel context.CancelFunc, writeProcHint func()) (err error) {
go func() {
defer cancel()

Expand All @@ -57,5 +56,5 @@ func cmdStart(cmd *exec.Cmd, cancel context.CancelFunc, writeProcHint func()) er
writeProcHint()
_ = cmd.Wait() // Envoy logs like "caught SIGINT" or "caught ENVOY_SIGTERM", so we don't repeat logging here.
}()
return err
return
}
5 changes: 2 additions & 3 deletions internal/moreos/proc_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ func isExecutable(f os.FileInfo) bool {
return f.Mode()&0111 != 0
}

func cmdStart(cmd *exec.Cmd, cancel context.CancelFunc, writeProcHint func()) error {
var err error
func cmdStart(cmd *exec.Cmd, cancel context.CancelFunc, writeProcHint func()) (err error) {
go func() {
// On Linux, pdeathsig will kill the child process when the thread dies, not when the process
// dies. runtime.LockOSThread ensures that as long as this function is executing that OS thread
Expand All @@ -67,5 +66,5 @@ func cmdStart(cmd *exec.Cmd, cancel context.CancelFunc, writeProcHint func()) er
writeProcHint()
_ = cmd.Wait() // Envoy logs like "caught SIGINT" or "caught ENVOY_SIGTERM", so we don't repeat logging here.
}()
return err
return
}
5 changes: 2 additions & 3 deletions internal/moreos/proc_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ func isExecutable(f os.FileInfo) bool { // In windows, we cannot read execute bi
return strings.HasSuffix(f.Name(), ".exe")
}

func cmdStart(cmd *exec.Cmd, cancel context.CancelFunc, writeProcHint func()) error {
var err error
func cmdStart(cmd *exec.Cmd, cancel context.CancelFunc, writeProcHint func()) (err error) {
go func() {
defer cancel()

Expand All @@ -104,5 +103,5 @@ func cmdStart(cmd *exec.Cmd, cancel context.CancelFunc, writeProcHint func()) er
writeProcHint()
_ = cmd.Wait() // Envoy logs like "caught SIGINT" or "caught ENVOY_SIGTERM", so we don't repeat logging here.
}()
return err
return
}

0 comments on commit cef7467

Please sign in to comment.