1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-08 06:48:28 +00:00

Make it compilable on FreeBSD 12 after struct inpcb and struct tcpcb were

stopped being exported.
This commit is contained in:
Gleb Smirnoff 2017-03-21 07:36:38 +00:00
parent 53632a702b
commit 4945dd9127
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=436567
2 changed files with 43 additions and 5 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= sigar
PORTVERSION= 1.7.3
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= devel
MAINTAINER= tj@FreeBSD.org

View File

@ -1,6 +1,6 @@
--- src/os/darwin/darwin_sigar.c.orig 2014-11-17 21:46:20 UTC
+++ src/os/darwin/darwin_sigar.c
@@ -399,9 +399,13 @@ static int sigar_vmstat(sigar_t *sigar,
--- src/os/darwin/darwin_sigar.c.orig 2014-11-17 13:46:20.000000000 -0800
+++ src/os/darwin/darwin_sigar.c 2017-03-20 23:32:31.935016000 -0700
@@ -399,9 +399,13 @@
GET_VM_STATS(vm, v_active_count, 0);
GET_VM_STATS(vm, v_inactive_target, 0);
GET_VM_STATS(vm, v_inactive_count, 1);
@ -14,7 +14,7 @@
GET_VM_STATS(vm, v_pageout_free_min, 0);
GET_VM_STATS(vm, v_interrupt_free_min, 0);
GET_VM_STATS(vm, v_forks, 0);
@@ -479,7 +483,11 @@ int sigar_mem_get(sigar_t *sigar, sigar_
@@ -479,7 +483,11 @@
kern *= sigar->pagesize;
#elif defined(__FreeBSD__)
if ((status = sigar_vmstat(sigar, &vmstat)) == SIGAR_OK) {
@ -26,3 +26,41 @@
kern *= sigar->pagesize;
mem->free = vmstat.v_free_count;
mem->free *= sigar->pagesize;
@@ -3055,8 +3063,13 @@
int type, istcp = 0;
char *buf;
const char *mibvar;
+#if defined(__FreeBSD__) && (__FreeBSD_version >= 1200026)
+ struct xtcpcb *tp = NULL;
+ struct xinpcb *inp;
+#else
struct tcpcb *tp = NULL;
struct inpcb *inp;
+#endif
struct xinpgen *xig, *oxig;
struct xsocket *so;
size_t len;
@@ -3094,6 +3107,15 @@
xig->xig_len > sizeof(struct xinpgen);
xig = (struct xinpgen *)((char *)xig + xig->xig_len))
{
+#if defined(__FreeBSD__) && (__FreeBSD_version >= 1200026)
+ if (istcp) {
+ tp = (struct xtcpcb *)xig;
+ inp = &tp->xt_inp;
+ } else {
+ inp = (struct xinpcb *)xig;
+ }
+ so = &inp->xi_socket;
+#else
if (istcp) {
struct xtcpcb *cb = (struct xtcpcb *)xig;
tp = &cb->xt_tp;
@@ -3105,6 +3127,7 @@
inp = &cb->xi_inp;
so = &cb->xi_socket;
}
+#endif
if (so->xso_protocol != proto) {
continue;