Skip to content

Commit

Permalink
fix(ping): fix fallback for ping
Browse files Browse the repository at this point in the history
Signed-off-by: Yagiz Degirmenci <yagizcanilbey1903@gmail.com>
  • Loading branch information
ycd committed Nov 22, 2021
1 parent 1ce9bf2 commit fba4e3e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/ping/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ func runPingFallback(ctx context.Context, addr common.Address, count int) (commo
args := fmt.Sprintf("-c %v", count)
command := fmt.Sprintf("ping %s %s", args, addr.String())

var err error
// This is not handled because the ping
// writes the output to stdout whether it fails or not
out, err := executeCommand(command)
if err != nil {
return common.Output(""), err
}

po, err := parsePingOutput(out)
if err != nil {
Expand Down Expand Up @@ -106,7 +106,7 @@ func executeCommand(command string) (string, error) {
}

if err := cmd.Wait(); err != nil {
return "", fmt.Errorf("got error: %v, stderr: %v", err, errb.String())
return out, fmt.Errorf("got error: %v, stderr: %v", err, errb.String())
}

return out, nil
Expand Down

0 comments on commit fba4e3e

Please sign in to comment.