summaryrefslogtreecommitdiff
path: root/psutil/_psbsd.py
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2016-10-26 16:22:42 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2016-10-26 16:22:42 +0200
commitfdce989ff82a7663f6c198a5d3deaec47e5a6635 (patch)
tree4fff4ce4a9dc080bb91ebd3f4cffe76a8d89d522 /psutil/_psbsd.py
parentdbb8ddef7226f8e61e40f27e1d276d328fb8d4f6 (diff)
downloadpsutil-fdce989ff82a7663f6c198a5d3deaec47e5a6635.tar.gz
netbsd / connections: refactoring
Diffstat (limited to 'psutil/_psbsd.py')
-rw-r--r--psutil/_psbsd.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/psutil/_psbsd.py b/psutil/_psbsd.py
index 206e0fd2..caace16b 100644
--- a/psutil/_psbsd.py
+++ b/psutil/_psbsd.py
@@ -342,7 +342,10 @@ def net_connections(kind):
% (kind, ', '.join([repr(x) for x in conn_tmap])))
families, types = conn_tmap[kind]
ret = set()
- rawlist = cext.net_connections()
+ if NETBSD:
+ rawlist = cext.net_connections(-1)
+ else:
+ rawlist = cext.net_connections()
for item in rawlist:
fd, fam, type, laddr, raddr, status, pid = item
# TODO: apply filter at C level
@@ -579,9 +582,10 @@ class Process(object):
if NETBSD:
families, types = conn_tmap[kind]
ret = set()
- rawlist = cext.proc_connections(self.pid)
+ rawlist = cext.net_connections(self.pid)
for item in rawlist:
- fd, fam, type, laddr, raddr, status = item
+ fd, fam, type, laddr, raddr, status, pid = item
+ assert pid == self.pid
if fam in families and type in types:
try:
status = TCP_STATUSES[status]