mirror of
https://github.com/shirou/gopsutil.git
synced 2025-05-10 19:29:14 +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
|
||||
}
|
||||
|
||||
lsof := exec.Command(lsof_bin, "-p", strconv.Itoa(int(p.Pid)), "-Fn")
|
||||
awk := exec.Command(awk_bin, "NR==3{print}")
|
||||
lsof := exec.Command(lsof_bin, "-p", strconv.Itoa(int(p.Pid)), "-Fpfn")
|
||||
awk := exec.Command(awk_bin, "NR==5{print}")
|
||||
sed := exec.Command(sed_bin, "s/n\\//\\//")
|
||||
|
||||
output, _, err := common.Pipeline(lsof, awk, sed)
|
||||
|
Loading…
x
Reference in New Issue
Block a user