summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2016-02-28 13:18:12 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2016-02-28 13:18:12 +0100
commit43394049b01c0107e928f818f23f7666be99505f (patch)
tree822d20c8b2c8722565d6da860bf09427a27d8d10
parentd9c7e3cbb86e004279fa93238873611a251c15c0 (diff)
parent0da8c27a47673814f0a64bf4988fcd6d131bc3d6 (diff)
downloadpsutil-43394049b01c0107e928f818f23f7666be99505f.tar.gz
Merge branch 'master' of github.com:giampaolo/psutil
-rw-r--r--HISTORY.rst2
-rw-r--r--psutil/_psbsd.py1
-rw-r--r--psutil/_psutil_bsd.c7
-rw-r--r--psutil/tests/test_misc.py12
4 files changed, 9 insertions, 13 deletions
diff --git a/HISTORY.rst b/HISTORY.rst
index 3c4dfa7a..5ba233b8 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -10,6 +10,8 @@ Bug tracker at https://github.com/giampaolo/psutil/issues
**Bug fixes**
+- #774: [FreeBSD] net_io_counters() dropout is no longer set to 0 if the kernel
+ provides it.
- #776: [Linux] Process.cpu_affinity() may erroneously raise NoSuchProcess.
(patch by wxwright)
diff --git a/psutil/_psbsd.py b/psutil/_psbsd.py
index 273426b2..b43e052a 100644
--- a/psutil/_psbsd.py
+++ b/psutil/_psbsd.py
@@ -99,6 +99,7 @@ svmem = namedtuple(
scputimes = namedtuple(
'scputimes', ['user', 'nice', 'system', 'idle', 'irq'])
pmem = namedtuple('pmem', ['rss', 'vms', 'text', 'data', 'stack'])
+pfullmem = pmem
pmmap_grouped = namedtuple(
'pmmap_grouped', 'path rss, private, ref_count, shadow_count')
pmmap_ext = namedtuple(
diff --git a/psutil/_psutil_bsd.c b/psutil/_psutil_bsd.c
index fa596d34..db05dc8e 100644
--- a/psutil/_psutil_bsd.c
+++ b/psutil/_psutil_bsd.c
@@ -812,7 +812,12 @@ psutil_net_io_counters(PyObject *self, PyObject *args) {
if2m->ifm_data.ifi_ierrors,
if2m->ifm_data.ifi_oerrors,
if2m->ifm_data.ifi_iqdrops,
- 0); // dropout not supported
+#ifdef _IFI_OQDROPS
+ if2m->ifm_data.ifi_oqdrops
+#else
+ 0
+#endif
+ );
if (!py_ifc_info)
goto error;
if (PyDict_SetItemString(py_retdict, ifc_name, py_ifc_info))
diff --git a/psutil/tests/test_misc.py b/psutil/tests/test_misc.py
index c35e0d35..c8e17281 100644
--- a/psutil/tests/test_misc.py
+++ b/psutil/tests/test_misc.py
@@ -324,18 +324,6 @@ class TestMisc(unittest.TestCase):
finally:
importlib.reload(psutil)
- # https://travis-ci.org/giampaolo/psutil/jobs/111419416
- @unittest.skipIf(TRAVIS and LINUX, "skipped on travis")
- def test_memory_percent_0_division(self):
- import collections
- try:
- retval = collections.namedtuple("mem", "total")(0)
- with mock.patch(
- "psutil._psplatform.virtual_memory", return_value=retval):
- self.assertRaises(ValueError, psutil.Process().memory_percent)
- finally:
- importlib.reload(psutil)
-
# ===================================================================
# --- Example script tests