commit a6bd4cffa767a09ac35fbbb53e0a2647fbf00385
Author: Robert Story <rstory@users.sourceforge.net>
Date:   Fri Apr 10 20:13:23 2009 +0000

    restore annoying log message, but fix cause of it on !freebsd systems
    
    git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@17493 06827809-a52a-0410-b366-d66718629ded

commit e377e89305194e19ffc39d6d88d84d236faca559
Author: Dave Shield <dts12@users.sourceforge.net>
Date:   Sun Jan 9 18:13:50 2011 +0000

    sysctl takes a 'size_t' variable for the size parameter
    
    
    git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@19830 06827809-a52a-0410-b366-d66718629ded

commit 55eea37241a599898ce61f364a6a07d856202fad
Author: Thomas Anders <tanders@users.sourceforge.net>
Date:   Sun Jan 30 01:06:21 2011 +0000

    CHANGES: snmpd: BUG: 3151897: fd leak w/ /proc/partitions
    read in diskio
    
    
    git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/branches/V5-3-patches@19899 06827809-a52a-0410-b366-d66718629ded

Index: agent/mibgroup/host/hr_system.c
===================================================================
--- agent/mibgroup/host/hr_system.c.orig
+++ agent/mibgroup/host/hr_system.c
@@ -223,7 +223,7 @@ var_hrsys(struct variable * vp,
 #endif
 #if NETSNMP_CAN_USE_SYSCTL && defined(CTL_KERN) && defined(KERN_MAXPROC)
     static int      maxproc_mib[] = { CTL_KERN, KERN_MAXPROC };
-    int             buf_size;
+    size_t          buf_size;
 #endif
 #if defined(hpux10) || defined(hpux11)
     struct pst_static pst_buf;
Index: agent/mibgroup/ucd-snmp/diskio.c
===================================================================
--- agent/mibgroup/ucd-snmp/diskio.c.orig
+++ agent/mibgroup/ucd-snmp/diskio.c
@@ -148,9 +148,11 @@ init_diskio(void)
         {DISKIO_NWRITTEN, ASN_COUNTER, RONLY, var_diskio, 1, {4}},
         {DISKIO_READS, ASN_COUNTER, RONLY, var_diskio, 1, {5}},
         {DISKIO_WRITES, ASN_COUNTER, RONLY, var_diskio, 1, {6}},
+#if defined(freebsd4) || defined(freebsd5)
         {DISKIO_LA1, ASN_INTEGER, RONLY, var_diskio, 1, {9}},
         {DISKIO_LA5, ASN_INTEGER, RONLY, var_diskio, 1, {10}},
         {DISKIO_LA15, ASN_INTEGER, RONLY, var_diskio, 1, {11}},
+#endif
         {DISKIO_NREADX, ASN_COUNTER64, RONLY, var_diskio, 1, {12}},
         {DISKIO_NWRITTENX, ASN_COUNTER64, RONLY, var_diskio, 1, {13}},
     };
@@ -319,7 +321,8 @@ getstats(void)
     time_t          now;
     int             mib[2];
     char           *t, *tp;
-    int             size, dkn_size, i;
+    size_t          size, dkn_size;
+    int             i;
 
     now = time(NULL);
     if (cache_time + CACHE_TIMEOUT > now) {
@@ -766,6 +769,7 @@ int getstats(void)
 		    &pTemp->running, &pTemp->use, &pTemp->aveq);
             if (rc != 15) {
                snmp_log(LOG_ERR, "diskio.c: cannot find statistics in /proc/partitions\n");
+               fclose(parts);
                return 1;
             }
 	    head.length++;
Index: agent/mibgroup/ucd-snmp/proc.c
===================================================================
--- agent/mibgroup/ucd-snmp/proc.c.orig
+++ agent/mibgroup/ucd-snmp/proc.c
@@ -360,8 +360,8 @@ get_proc_instance(struct myproc *proc, o
  * these are for keeping track of the proc array 
  */
 
-static int      nproc = 0;
-static int      onproc = -1;
+static size_t   nproc = 0;
+static size_t   onproc = -1;
 static struct kinfo_proc *pbase = 0;
 
 int
Index: agent/mibgroup/ucd-snmp/vmstat_bsdi4.c
===================================================================
--- agent/mibgroup/ucd-snmp/vmstat_bsdi4.c.orig
+++ agent/mibgroup/ucd-snmp/vmstat_bsdi4.c
@@ -148,9 +148,9 @@ var_extensible_vmstat(struct variable *v
 
     static struct vmmeter mem_old, mem_new;
     int             mem_mib[] = { CTL_VM, VM_CNT };
-    int             mem_size = sizeof(struct vmmeter);
+    size_t          mem_size = sizeof(struct vmmeter);
     int             cpu_mib[] = { CTL_KERN, KERN_CPUSTATS };
-    int             cpu_size = sizeof(struct cpustats);
+    size_t          cpu_size = sizeof(struct cpustats);
 
     static long     long_ret;
     static char     errmsg[300];
Index: agent/mibgroup/ucd-snmp/vmstat_netbsd1.c
===================================================================
--- agent/mibgroup/ucd-snmp/vmstat_netbsd1.c.orig
+++ agent/mibgroup/ucd-snmp/vmstat_netbsd1.c
@@ -170,7 +170,7 @@ var_extensible_vmstat(struct variable *v
 
     static struct uvmexp mem_old, mem_new;
     int             mem_mib[] = { CTL_VM, VM_UVMEXP };
-    int             mem_size = sizeof(struct uvmexp);
+    size_t          mem_size = sizeof(struct uvmexp);
 
     static long     long_ret;
     static char     errmsg[300];
@@ -186,13 +186,13 @@ var_extensible_vmstat(struct variable *v
     if (time_new != time_old) {
 #ifdef KERN_CP_TIME
         int             mib[2] = { CTL_KERN, KERN_CP_TIME };
-        int             ssize = sizeof(cpu_new);
+        size_t          ssize = sizeof(cpu_new);
 
         if (sysctl(mib, 2, cpu_new, &ssize, NULL, 0) < 0)
             memset(cpu_new, 0, sizeof(cpu_new));
 #elif defined(KERN_CPTIME)
         int             mib[2] = { CTL_KERN, KERN_CPTIME };
-        int             ssize = sizeof(cpu_new);
+        size_t          ssize = sizeof(cpu_new);
 
         if (sysctl(mib, 2, cpu_new, &ssize, NULL, 0) < 0)
             memset(cpu_new, 0, sizeof(cpu_new));
