portlist: make two error paths have unique messages

For debugging #339
This commit is contained in:
Brad Fitzpatrick 2020-05-04 07:44:41 -07:00
parent fefd7e10dc
commit 3b546dc29a
1 changed files with 2 additions and 2 deletions

View File

@ -110,7 +110,7 @@ func addProcesses(pl []Port) ([]Port, error) {
return nil
}
if err != nil {
return fmt.Errorf("readdir: %w", err)
return fmt.Errorf("addProcesses.readDir: %w", err)
}
for _, fd := range fds {
n, err := unix.Readlink(fmt.Sprintf("/proc/%s/fd/%s", pid, fd), targetBuf)
@ -155,7 +155,7 @@ func foreachPID(fn func(pidStr string) error) error {
return nil
}
if err != nil {
return err
return fmt.Errorf("foreachPID.readdir: %w", err)
}
for _, pid := range pids {