Don't read tcp6 file (we don't deal with ipv6 anywhere else).

This commit is contained in:
Tom Wilkie
2015-12-09 17:45:33 +00:00
parent 9cff5699cb
commit cc90c6c95d

View File

@@ -37,15 +37,12 @@ func walkProcPid(buf *bytes.Buffer, walker process.Walker) (map[uint64]Proc, err
// Read network namespace, and if we haven't seen it before,
// read /proc/<pid>/net/tcp
err := fs.Lstat(filepath.Join(procRoot, dirName, "/ns/net"), &statT)
if err != nil {
if err := fs.Lstat(filepath.Join(procRoot, dirName, "/ns/net"), &statT); err != nil {
return
}
if _, ok := namespaces[statT.Ino]; !ok {
namespaces[statT.Ino] = struct{}{}
readFile(filepath.Join(procRoot, dirName, "/net/tcp"), buf)
readFile(filepath.Join(procRoot, dirName, "/net/tcp6"), buf)
}
fds, err := fs.ReadDirNames(fdBase)