From 6e3f81ce18e9502a98812f142b3ef273026287e4 Mon Sep 17 00:00:00 2001 From: Shirou WAKAYAMA Date: Sun, 11 Oct 2015 22:15:47 +0900 Subject: [PATCH] net[linux]: fix lsof output --- common/common_unix.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/common_unix.go b/common/common_unix.go index 21aaa1e..d0557ad 100644 --- a/common/common_unix.go +++ b/common/common_unix.go @@ -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")