diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2016-10-27 15:15:28 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2016-10-27 15:15:28 +0200 |
commit | 0ccd1373c6e7a189e095df5c436568fb1e8b4d14 (patch) | |
tree | 3ecbf84d5acd5a5676a6a62a44410d34fa405c57 /psutil/_psbsd.py | |
parent | 7ad634a34da12325b70f07d2a2c6447f402cbf3e (diff) | |
parent | 476eea61feb38e2f2dccfc5adcb24dd883981b07 (diff) | |
download | psutil-0ccd1373c6e7a189e095df5c436568fb1e8b4d14.tar.gz |
Merge branch 'master' into oneshot
Diffstat (limited to 'psutil/_psbsd.py')
-rw-r--r-- | psutil/_psbsd.py | 10 |
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] |