Skip to content

Commit

Permalink
fix #501: [Windows] disk_io_counters() may return negative values.
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Sep 21, 2014
1 parent e1d1fd7 commit 5804cf2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
17 changes: 9 additions & 8 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@ Bug tracker at https://github.com/giampaolo/psutil/issues

**Bug fixes**

- #340: [Windows]: Process.get_open_files() no longer hangs. (patch by
- #340: [Windows] Process.get_open_files() no longer hangs. (patch by
Jeff Tang)
- #503: [Linux]: in rare conditions Process exe(), open_files() and
- #501: [Windows] disk_io_counters() may return negative values.
- #503: [Linux] in rare conditions Process exe(), open_files() and
connections() methods can raise OSError(ESRCH) instead of NoSuchProcess.
- #504: [Linux]: can't build RPM packages via setup.py
- #506: [Linux]: python 2.4 support was broken.
- #522: [Linux]: Process.cpu_affinity() might return EINVAL. (patch by David
- #504: [Linux] can't build RPM packages via setup.py
- #506: [Linux] python 2.4 support was broken.
- #522: [Linux] Process.cpu_affinity() might return EINVAL. (patch by David
Daeschler)
- #529: [Windows]: Process.exe() may raise unhandled WindowsError exception
- #529: [Windows] Process.exe() may raise unhandled WindowsError exception
for PIDs 0 and 4. (patch by Jeff Tang)
- #530: [Linux]: psutil.disk_io_counters() may crash on old Linux distros
- #530: [Linux] psutil.disk_io_counters() may crash on old Linux distros
(< 2.6.5) (patch by Yaolong Huang)
- #533: [Linux]: Process.memory_maps() may raise TypeError on old Linux distros.
- #533: [Linux] Process.memory_maps() may raise TypeError on old Linux distros.


2.1.1 - 2014-04-30
Expand Down
6 changes: 3 additions & 3 deletions psutil/_psutil_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -2435,13 +2435,13 @@ psutil_disk_io_counters(PyObject *self, PyObject *args)
{
sprintf(szDeviceDisplay, "PhysicalDrive%d", devNum);
py_disk_info = Py_BuildValue(
"(IILLLL)",
"(IILLKK)",
diskPerformance.ReadCount,
diskPerformance.WriteCount,
diskPerformance.BytesRead,
diskPerformance.BytesWritten,
(diskPerformance.ReadTime.QuadPart * 10) / 1000,
(diskPerformance.WriteTime.QuadPart * 10) / 1000);
(unsigned long long)(diskPerformance.ReadTime.QuadPart * 10) / 1000,
(unsigned long long)(diskPerformance.WriteTime.QuadPart * 10) / 1000);
if (!py_disk_info)
goto error;
if (PyDict_SetItemString(py_retdict, szDeviceDisplay,
Expand Down

0 comments on commit 5804cf2

Please sign in to comment.