diff options
author | crees <crees@FreeBSD.org> | 2013-04-13 19:49:01 +0800 |
---|---|---|
committer | crees <crees@FreeBSD.org> | 2013-04-13 19:49:01 +0800 |
commit | 4fde992e7c9477a817ce6836278ba4d10ffe049e (patch) | |
tree | 7a8f82c6e1d8728f3909c246fc4306a4dd4fb825 /sysutils | |
parent | 6ea9b7e7603e060b0442c9ac089869effe1217c1 (diff) | |
download | freebsd-ports-gnome-4fde992e7c9477a817ce6836278ba4d10ffe049e.tar.gz freebsd-ports-gnome-4fde992e7c9477a817ce6836278ba4d10ffe049e.tar.zst freebsd-ports-gnome-4fde992e7c9477a817ce6836278ba4d10ffe049e.zip |
Fix on FreeBSD 8+
PR: ports/172803
Submitted by: Jan Beich
Approved by: maintainer timeout (sunpoet, ~6 months)
Approved by: portmgr (decke)
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/py-psutil/Makefile | 7 | ||||
-rw-r--r-- | sysutils/py-psutil/files/patch-psutil-_psutil_bsd.c | 30 |
2 files changed, 32 insertions, 5 deletions
diff --git a/sysutils/py-psutil/Makefile b/sysutils/py-psutil/Makefile index 43d990bee5c4..8939a729f31e 100644 --- a/sysutils/py-psutil/Makefile +++ b/sysutils/py-psutil/Makefile @@ -1,12 +1,9 @@ -# New ports collection makefile for: py-psutil -# Date created: 04 May 2010 -# Whom: Ju Pengfei <jupengfei@gmail.com> -# +# Created by: Ju Pengfei <jupengfei@gmail.com> # $FreeBSD$ -# PORTNAME= psutil PORTVERSION= 0.6.1 +PORTREVISION= 1 CATEGORIES= sysutils python MASTER_SITES= GOOGLE_CODE PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} diff --git a/sysutils/py-psutil/files/patch-psutil-_psutil_bsd.c b/sysutils/py-psutil/files/patch-psutil-_psutil_bsd.c index bb6cee507339..11b01ee3bfc2 100644 --- a/sysutils/py-psutil/files/patch-psutil-_psutil_bsd.c +++ b/sysutils/py-psutil/files/patch-psutil-_psutil_bsd.c @@ -1,5 +1,35 @@ --- psutil/_psutil_bsd.c.orig 2012-08-16 23:07:37.000000000 +0800 +++ psutil/_psutil_bsd.c 2012-09-27 14:50:20.843763756 +0800 +@@ -576,12 +576,19 @@ get_process_memory_info(PyObject* self, + static PyObject* + get_virtual_mem(PyObject* self, PyObject* args) + { +- unsigned int total, active, inactive, wired, cached, free, buffers; ++ unsigned int total, active, inactive, wired, cached, free; + size_t size = sizeof(total); + struct vmtotal vm; + int mib[] = {CTL_VM, VM_METER}; + long pagesize = getpagesize(); + ++#if __FreeBSD_version > 702101 ++ long buffers; ++#else ++ int buffers; ++#endif ++ size_t buffers_size = sizeof(buffers); ++ + if (sysctlbyname("vm.stats.vm.v_page_count", &total, &size, NULL, 0)) + goto error; + if (sysctlbyname("vm.stats.vm.v_active_count", &active, &size, NULL, 0)) +@@ -594,7 +601,7 @@ get_virtual_mem(PyObject* self, PyObject + goto error; + if (sysctlbyname("vm.stats.vm.v_free_count", &free, &size, NULL, 0)) + goto error; +- if (sysctlbyname("vfs.bufspace", &buffers, &size, NULL, 0)) ++ if (sysctlbyname("vfs.bufspace", &buffers, &buffers_size, NULL, 0)) + goto error; + + size = sizeof(vm); @@ -1376,8 +1376,10 @@ strlcat(opts, ",noclusterr", sizeof(opts)); if (flags & MNT_NOCLUSTERW) |