summaryrefslogtreecommitdiff
path: root/psutil
diff options
context:
space:
mode:
authorThomas Klausner <wiz@gatalith.at>2022-08-18 19:16:05 +0200
committerGitHub <noreply@github.com>2022-08-18 19:16:05 +0200
commit84219ad536370eda325d27947831be270e7077b0 (patch)
tree9891bb1f7478453b0748e7b4dbdcb2ce43541410 /psutil
parentdf3fba560125a1694140418458d85076ebc546fd (diff)
downloadpsutil-84219ad536370eda325d27947831be270e7077b0.tar.gz
[NetBSD] two fixes for swap code (#2128)
Diffstat (limited to 'psutil')
-rw-r--r--psutil/arch/netbsd/specific.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/psutil/arch/netbsd/specific.c b/psutil/arch/netbsd/specific.c
index 4e286e5e..11b8c1dd 100644
--- a/psutil/arch/netbsd/specific.c
+++ b/psutil/arch/netbsd/specific.c
@@ -459,7 +459,7 @@ psutil_virtual_mem(PyObject *self, PyObject *args) {
(unsigned long long) uv.active << uv.pageshift, // active
(unsigned long long) uv.inactive << uv.pageshift, // inactive
(unsigned long long) uv.wired << uv.pageshift, // wired
- (unsigned long long) uv.filepages + uv.execpages * pagesize, // cached
+ (unsigned long long) (uv.filepages + uv.execpages) * pagesize, // cached
// These are determined from /proc/meminfo in Python.
(unsigned long long) 0, // buffers
(unsigned long long) 0 // shared
@@ -495,8 +495,8 @@ psutil_swap_mem(PyObject *self, PyObject *args) {
swap_total = swap_free = 0;
for (i = 0; i < nswap; i++) {
if (swdev[i].se_flags & SWF_ENABLE) {
- swap_total += swdev[i].se_nblks * DEV_BSIZE;
- swap_free += (swdev[i].se_nblks - swdev[i].se_inuse) * DEV_BSIZE;
+ swap_total += (uint64_t)swdev[i].se_nblks * DEV_BSIZE;
+ swap_free += (uint64_t)(swdev[i].se_nblks - swdev[i].se_inuse) * DEV_BSIZE;
}
}
free(swdev);