Date: Mon, 12 May 1997 15:50:03 -0700 (PDT) From: Bill Fenner <fenner@parc.xerox.com> To: freebsd-ports Subject: Re: ports/3414: ucd-snmp port doesn't build under 2.2 Message-ID: <199705122250.PAA10843@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/3414; it has been noted by GNATS. From: Bill Fenner <fenner@parc.xerox.com> To: freebsd-gnats-submit@freebsd.org Cc: Subject: Re: ports/3414: ucd-snmp port doesn't build under 2.2 Date: Mon, 12 May 1997 15:40:30 PDT Here's a patch to patch-aa to make it build under 2.2, as well as a new patch-ae file which gets rid of the warning messages from free(). I submitted the patch-ae bit to the ucd-snmp authors. Bill --- patch-aa.orig Mon May 12 22:29:06 1997 +++ patch-aa Mon May 12 22:29:08 1997 @@ -75,23 +75,21 @@ long_return = 0; Index: agent/extensible/extensible.c =================================================================== -RCS file: /home/pcvs/ports/ucd-snmp/agent/extensible/extensible.c,v -retrieving revision 1.1.1.1 -diff -u -r1.1.1.1 extensible.c ---- extensible.c 1997/03/07 09:06:12 1.1.1.1 -+++ extensible.c 1997/03/07 11:07:46 -@@ -75,6 +75,10 @@ +--- agent/extensible/extensible.c.orig Wed Feb 5 16:10:34 1997 ++++ agent/extensible/extensible.c Mon May 12 22:20:20 1997 +@@ -75,6 +75,11 @@ #if STDC_HEADERS #include <string.h> #endif +#ifdef freebsd2 +#include <sys/rlist.h> ++#include <vm/vm_param.h> +#include <osreldate.h> +#endif #include "mibincl.h" #include "mibdefs.h" -@@ -101,7 +105,8 @@ +@@ -101,7 +106,8 @@ static int exceptions[] = SECURITYEXCEPTIONS; #endif @@ -101,7 +99,7 @@ register struct variable *vp; register oid *name; register int *length; -@@ -133,8 +138,7 @@ +@@ -133,8 +139,7 @@ memmove(newname, vp->name, (int)vp->namelen * sizeof (oid)); newname[vp->namelen] = 1; *length = vp->namelen+1; @@ -111,7 +109,7 @@ *length = vp->namelen+1; memmove(newname, name, (*length) * sizeof(oid)); if (!exact) -@@ -171,6 +175,33 @@ +@@ -171,6 +176,33 @@ } #define pagetok(size) ((size) << pageshift) @@ -145,7 +143,7 @@ #define NL_AVENRUN 0 #define NL_TOTAL 1 #define NL_SWDEVT 2 -@@ -178,8 +209,6 @@ +@@ -178,8 +210,6 @@ #define NL_NSWAPFS 4 #define NL_NSWAPDEV 5 #define NL_PHYSMEM 6 @@ -154,7 +152,7 @@ static struct nlist nl[] = { #if !defined(hpux) && !defined(solaris2) { "_avenrun"}, -@@ -201,6 +230,8 @@ +@@ -201,6 +231,8 @@ { 0 } }; @@ -163,7 +161,7 @@ #define SWAPGETLEFT 0 #define SWAPGETTOTAL 1 -@@ -209,7 +240,144 @@ +@@ -209,7 +241,144 @@ #ifdef USEMEMMIB @@ -309,7 +307,7 @@ int rettype; { int spaceleft=0, spacetotal=0, i, fd; -@@ -230,15 +398,18 @@ +@@ -230,15 +399,18 @@ if (KNLookup(NL_SWDEVT,(int *) swdevt, sizeof(struct swdevt)*nswapdev) == NULL) return(0); @@ -328,7 +326,7 @@ for (i=0; i < nswapfs; i++) { if (fswdevt[i].fsw_enable) { spacetotal += (fswdevt[i].fsw_limit * 2048); /* 2048=bytes per page? */ -@@ -247,6 +418,7 @@ +@@ -247,6 +419,7 @@ /* 37 = calculated value I know it makes no sense, nor is it accurate */ } } @@ -336,7 +334,7 @@ /* this is a real hack. I need to get the hold info from swapinfo, but I can't figure out how to read it out of the kernel directly -- Wes */ -@@ -271,20 +443,16 @@ +@@ -271,20 +444,16 @@ return(spacetotal); } } @@ -366,7 +364,7 @@ { oid newname[30]; -@@ -298,11 +466,15 @@ +@@ -298,11 +467,15 @@ if (!checkmib(vp,name,length,exact,var_len,write_method,newname,1)) return(NULL); @@ -383,7 +381,7 @@ if (sysctl(mib, 2, &total, &size, NULL, 0) < 0) return (0); } #else -@@ -328,7 +500,7 @@ +@@ -328,7 +501,7 @@ long_ret = minimumswap; return((u_char *) (&long_ret)); case MEMTOTALREAL: @@ -392,7 +390,7 @@ { size_t size = sizeof(long_ret); static int mib[] = { CTL_HW, HW_PHYSMEM }; -@@ -345,8 +517,15 @@ +@@ -345,8 +518,15 @@ case MEMUSEDREAL: long_ret = pagetok((int) total.t_arm); return((u_char *) (&long_ret)); @@ -409,7 +407,7 @@ long_ret = pagetok(total.t_vmtxt); #endif return((u_char *) (&long_ret)); -@@ -365,6 +544,7 @@ +@@ -365,6 +545,7 @@ long_ret = pagetok(total.t_armtxt); #endif return((u_char *) (&long_ret)); @@ -417,7 +415,7 @@ case MEMTOTALFREE: long_ret = pagetok(total.t_free); return((u_char *) (&long_ret)); -@@ -382,15 +562,15 @@ +@@ -382,15 +563,15 @@ return((u_char *) (errmsg)); } } @@ -436,7 +434,7 @@ register struct variable *vp; /* IN - pointer to variable entry that points here */ register oid *name; -@@ -415,16 +595,16 @@ +@@ -415,16 +596,16 @@ #if defined(HAVE_STATVFS) || defined(HAVE_STATFS) struct statvfs vfs; @@ -457,7 +455,7 @@ if (!checkmib(vp,name,length,exact,var_len,write_method,newname,numdisks)) return(NULL); -@@ -481,8 +661,7 @@ +@@ -481,8 +662,7 @@ *var_len = strlen(errmsg); return((u_char *) (errmsg)); } @@ -467,7 +465,7 @@ /* read the disk information */ if ((file = open(disks[disknum].device,0)) < 0) { fprintf(stderr,"Couldn't open device %s\n",disks[disknum].device); -@@ -536,14 +715,15 @@ +@@ -536,14 +716,15 @@ } /*#endif*/ @@ -485,7 +483,7 @@ int lockd_timeout() { -@@ -552,7 +732,8 @@ +@@ -552,7 +733,8 @@ */ #ifdef USELOCKDMIB @@ -495,7 +493,7 @@ char *msg; { -@@ -590,7 +771,8 @@ +@@ -590,7 +772,8 @@ } @@ -505,7 +503,7 @@ register struct variable *vp; /* IN - pointer to variable entry that points here */ register oid *name; -@@ -636,19 +818,14 @@ +@@ -636,19 +819,14 @@ #endif #ifdef USELOADAVEMIB @@ -533,7 +531,7 @@ { oid newname[30]; -@@ -755,7 +932,8 @@ +@@ -755,7 +933,8 @@ #ifdef USEERRORMIB @@ -543,7 +541,7 @@ register struct variable *vp; /* IN - pointer to variable entry that points here */ register oid *name; -@@ -885,7 +1063,8 @@ +@@ -885,7 +1064,8 @@ return compare((*ap)->miboid,(*ap)->miblen,(*bp)->miboid,(*bp)->miblen); } @@ -553,7 +551,7 @@ int a; { extern struct subtree *subtrees; -@@ -1013,7 +1192,7 @@ +@@ -1013,7 +1193,7 @@ } #ifdef USEMEMMIB @@ -562,7 +560,7 @@ if (KNLookup(NL_NSWAPDEV,(int *) &nswapdev, sizeof(nswapdev)) == NULL) return; -@@ -1021,7 +1200,15 @@ +@@ -1021,7 +1201,15 @@ == NULL) return; #endif --- /dev/null Mon May 12 22:30:40 1997 +++ patch-ae Mon May 12 22:29:22 1997 @@ -0,0 +1,13 @@ +--- snmplib/snmp_client.c.orig Mon May 12 15:08:04 1997 ++++ snmplib/snmp_client.c Mon May 12 15:11:42 1997 +@@ -189,6 +189,10 @@ + newvar->next_variable = 0; + } + } ++ newpdu->community = (u_char *)malloc(newpdu->community_len); ++ memmove(newpdu->community, pdu->community, newpdu->community_len); ++ newpdu->enterprise = (oid *)malloc(newpdu->enterprise_length); ++ memmove(newpdu->enterprise, pdu->enterprise, newpdu->enterprise_length); + state->status = STAT_SUCCESS; + } else if (op == TIMED_OUT){ + state->pdu = NULL;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199705122250.PAA10843>