diff --git a/common/common_unix.go b/common/common_unix.go index 66284cc..21aaa1e 100644 --- a/common/common_unix.go +++ b/common/common_unix.go @@ -22,11 +22,10 @@ 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 + // if no pid found, lsof returnes code 1 but have output. if err.Error() == "exit status 1" && len(out) == 0 { - return []string{}, nil + return []string{}, err } - return []string{}, err } lines := strings.Split(string(out), "\n")