[process][darwin][nocgo] Fix #867 iterate on every lines returned by lsof to handle potential warnings

This commit is contained in:
Lomanic 2020-05-20 23:50:21 +02:00
parent c89193f22d
commit 8f969117ab
1 changed files with 1 additions and 1 deletions

View File

@ -22,7 +22,7 @@ func (p *Process) ExeWithContext(ctx context.Context) (string, error) {
} }
txtFound := 0 txtFound := 0
lines := strings.Split(string(out), "\n") lines := strings.Split(string(out), "\n")
for i := 1; i < len(lines); i += 2 { for i := 1; i < len(lines); i++ {
if lines[i] == "ftxt" { if lines[i] == "ftxt" {
txtFound++ txtFound++
if txtFound == 2 { if txtFound == 2 {