Skip to content

Commit

Permalink
net[linux]: fix lsof output
Browse files Browse the repository at this point in the history
  • Loading branch information
shirou committed Oct 11, 2015
1 parent 5ae4dcc commit 6e3f81c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/common_unix.go
Expand Up @@ -22,9 +22,9 @@ func CallLsof(invoke Invoker, pid int32, args ...string) ([]string, error) {
}
out, err := invoke.Command(lsof, cmd...)
if err != nil {
// if no pid found, lsof returnes code 1 but have output.
// if no pid found, lsof returnes code 1.
if err.Error() == "exit status 1" && len(out) == 0 {
return []string{}, err
return []string{}, nil
}
}
lines := strings.Split(string(out), "\n")
Expand Down

0 comments on commit 6e3f81c

Please sign in to comment.