packages: net-snmp/net-snmp-logging.patch - error about /proc/partitions al...

glen glen at pld-linux.org
Tue Dec 27 15:37:39 CET 2011


Author: glen                         Date: Tue Dec 27 14:37:39 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- error about /proc/partitions also only once

---- Files affected:
packages/net-snmp:
   net-snmp-logging.patch (1.2 -> 1.3) 

---- Diffs:

================================================================
Index: packages/net-snmp/net-snmp-logging.patch
diff -u packages/net-snmp/net-snmp-logging.patch:1.2 packages/net-snmp/net-snmp-logging.patch:1.3
--- packages/net-snmp/net-snmp-logging.patch:1.2	Tue Dec 27 15:29:34 2011
+++ packages/net-snmp/net-snmp-logging.patch	Tue Dec 27 15:37:34 2011
@@ -53,3 +53,28 @@
 +	first = 0;
  }
  
+--- net-snmp-5.7.1/./agent/mibgroup/ucd-snmp/diskio.c~	2011-09-28 07:53:47.000000000 +0300
++++ net-snmp-5.7.1/./agent/mibgroup/ucd-snmp/diskio.c	2011-12-27 16:33:10.128099629 +0200
+@@ -979,7 +979,8 @@
+ {
+     FILE* parts;
+     time_t now;
+-    
++    static int first = 1;
++
+     now = time(NULL);
+     if (cache_time + CACHE_TIMEOUT > now) {
+         return 0;
+@@ -1024,7 +1025,11 @@
+ 	int rc;
+ 	parts = fopen("/proc/partitions", "r");
+ 	if (!parts) {
+-	    snmp_log_perror("/proc/partitions");
++	    if (first) {
++		// log error only once
++		snmp_log_perror("/proc/partitions");
++		first = 0;
++	    }
+ 	    return 1;
+ 	}
+ 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/net-snmp/net-snmp-logging.patch?r1=1.2&r2=1.3&f=u



More information about the pld-cvs-commit mailing list