Add comments with a short explanation and link to the PR request

pull/361/head
Alexander Blagoev 8 years ago
parent 531f9507d2
commit b32353f094

@ -615,6 +615,10 @@ func processInet(file string, kind netConnectionKindType, inodes map[string][]in
return []connTmp{}, nil
}
// Read the contents of the /proc file with a single read sys call.
// This minimizes duplicates in the returned connections
// For more info:
// https://github.com/shirou/gopsutil/pull/361
contents, err := ioutil.ReadFile(file)
if err != nil {
return nil, err
@ -672,6 +676,10 @@ func processInet(file string, kind netConnectionKindType, inodes map[string][]in
}
func processUnix(file string, kind netConnectionKindType, inodes map[string][]inodeMap, filterPid int32) ([]connTmp, error) {
// Read the contents of the /proc file with a single read sys call.
// This minimizes duplicates in the returned connections
// For more info:
// https://github.com/shirou/gopsutil/pull/361
contents, err := ioutil.ReadFile(file)
if err != nil {
return nil, err

Loading…
Cancel
Save