summaryrefslogtreecommitdiff
path: root/psutil/_psbsd.py
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2016-10-27 15:15:28 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2016-10-27 15:15:28 +0200
commit0ccd1373c6e7a189e095df5c436568fb1e8b4d14 (patch)
tree3ecbf84d5acd5a5676a6a62a44410d34fa405c57 /psutil/_psbsd.py
parent7ad634a34da12325b70f07d2a2c6447f402cbf3e (diff)
parent476eea61feb38e2f2dccfc5adcb24dd883981b07 (diff)
downloadpsutil-0ccd1373c6e7a189e095df5c436568fb1e8b4d14.tar.gz
Merge branch 'master' into oneshot
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 5f8742df..a3301504 100644
--- a/psutil/_psbsd.py
+++ b/psutil/_psbsd.py
@@ -370,7 +370,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
@@ -641,9 +644,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]