[process]linux: change to use exec.LookPath to invoke lsof.

pull/162/head
Shirou WAKAYAMA 9 years ago
parent 821a0141b1
commit 97bcc355a6

@ -8,6 +8,7 @@ import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"strconv"
"strings"
@ -673,7 +674,11 @@ func callLsof(arg string, pid int32) ([]string, error) {
} else {
cmd = []string{"-a", "-F" + arg, "-p", strconv.Itoa(int(pid))}
}
out, err := invoke.Command("/usr/bin/lsof", cmd...)
lsof, err := exec.LookPath("lsof")
if err != nil {
return []string{}, err
}
out, err := invoke.Command(lsof, cmd...)
if err != nil {
return []string{}, err
}

Loading…
Cancel
Save