diff options
author | glebius <glebius@FreeBSD.org> | 2017-03-21 16:42:58 +0800 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2017-03-21 16:42:58 +0800 |
commit | 0760131add8d41fc78c36bebb39375f9769ddae3 (patch) | |
tree | ed2dd53bb55aaa4c984f7fc841de5651ca260899 /sysutils | |
parent | f8843428a02a3530999f205432bc38f9a3a6a83d (diff) | |
download | freebsd-ports-gnome-0760131add8d41fc78c36bebb39375f9769ddae3.tar.gz freebsd-ports-gnome-0760131add8d41fc78c36bebb39375f9769ddae3.tar.zst freebsd-ports-gnome-0760131add8d41fc78c36bebb39375f9769ddae3.zip |
Make it compilable on FreeBSD 12 after struct inpcb and struct tcpcb were
stopped being exported.
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/py-psutil121/Makefile | 2 | ||||
-rw-r--r-- | sysutils/py-psutil121/files/patch-_psutil_bsd.c | 50 |
2 files changed, 51 insertions, 1 deletions
diff --git a/sysutils/py-psutil121/Makefile b/sysutils/py-psutil121/Makefile index b6e672cfb160..87396d0d0be8 100644 --- a/sysutils/py-psutil121/Makefile +++ b/sysutils/py-psutil121/Makefile @@ -3,7 +3,7 @@ PORTNAME= psutil PORTVERSION= 1.2.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} diff --git a/sysutils/py-psutil121/files/patch-_psutil_bsd.c b/sysutils/py-psutil121/files/patch-_psutil_bsd.c new file mode 100644 index 000000000000..7ecc305d6f03 --- /dev/null +++ b/sysutils/py-psutil121/files/patch-_psutil_bsd.c @@ -0,0 +1,50 @@ +--- psutil/_psutil_bsd.c.orig 2017-03-21 00:39:17.505652000 -0700 ++++ psutil/_psutil_bsd.c 2017-03-21 00:41:20.821739000 -0700 +@@ -917,11 +917,19 @@ + psutil_sockaddr_addrlen(family)) == 0); + } + ++#if __FreeBSD_version >= 1200026 ++static struct xtcpcb * ++psutil_search_tcplist(char *buf, struct kinfo_file *kif) ++{ ++ struct xtcpcb *tp; ++ struct xinpcb *inp; ++#else + static struct tcpcb * + psutil_search_tcplist(char *buf, struct kinfo_file *kif) + { + struct tcpcb *tp; + struct inpcb *inp; ++#endif + struct xinpgen *xig, *oxig; + struct xsocket *so; + +@@ -929,9 +937,15 @@ + for (xig = (struct xinpgen *)((char *)xig + xig->xig_len); + xig->xig_len > sizeof(struct xinpgen); + xig = (struct xinpgen *)((char *)xig + xig->xig_len)) { ++#if __FreeBSD_version >= 1200026 ++ tp = (struct xtcpcb *)xig; ++ inp = &tp->xt_inp; ++ so = &inp->xi_socket; ++#else + tp = &((struct xtcpcb *)xig)->xt_tp; + inp = &((struct xtcpcb *)xig)->xt_inp; + so = &((struct xtcpcb *)xig)->xt_socket; ++#endif + + if (so->so_type != kif->kf_sock_type || + so->xso_family != kif->kf_sock_domain || +@@ -976,7 +990,11 @@ + struct kinfo_file *kif; + struct kinfo_proc kipp; + char *tcplist = NULL; ++#if __FreeBSD_version >= 1200026 ++ struct xtcpcb *tcp; ++#else + struct tcpcb *tcp; ++#endif + + PyObject *retList = PyList_New(0); + PyObject *tuple = NULL; |