mirror of
https://github.com/shirou/gopsutil.git
synced 2025-05-14 19:29:16 +08:00
Merge pull request #402 from chrisroberts/fix-exe-macos
Fix process.Exe() on macOS 10.12
This commit is contained in:
commit
1da5000996
@ -99,8 +99,8 @@ func (p *Process) Exe() (string, error) {
|
|||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
lsof := exec.Command(lsof_bin, "-p", strconv.Itoa(int(p.Pid)), "-Fn")
|
lsof := exec.Command(lsof_bin, "-p", strconv.Itoa(int(p.Pid)), "-Fpfn")
|
||||||
awk := exec.Command(awk_bin, "NR==3{print}")
|
awk := exec.Command(awk_bin, "NR==5{print}")
|
||||||
sed := exec.Command(sed_bin, "s/n\\//\\//")
|
sed := exec.Command(sed_bin, "s/n\\//\\//")
|
||||||
|
|
||||||
output, _, err := common.Pipeline(lsof, awk, sed)
|
output, _, err := common.Pipeline(lsof, awk, sed)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user