Merge branch 'collectd-4.0'
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sun, 24 Jun 2007 20:42:09 +0000 (22:42 +0200)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sun, 24 Jun 2007 20:42:09 +0000 (22:42 +0200)
ChangeLog
configure.in
contrib/PerlLib/Collectd.pm
src/collectd-nagios.c
src/cpu.c
src/interface.c
src/liboconfig/scanner.l
src/load.c
src/memory.c
src/utils_dns.c

index 79c117e..2d05d35 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-06-24, Version 4.0.4
+       * cpu plugin: Fixed the Solaris code.
+       * dns plugin: Fixed a build issue for OpenBSD.
+       * interface plugin: Fixed the Solaris code.
+       * load plugin: Fixed the alternative `/proc' Linux code.
+       * memory plugin: Fixed the Solaris code.
+       * oconfig: Don't require `-lfl' anymore.
+
 2007-06-19, Version 4.0.3
        * cpu plugin: Fix the Darwin / Mac OS X code.
        * ping plugin: Use the return value of `getpid', not its address.
index 2914b5a..cf423ed 100644 (file)
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(collectd, 4.0.3)
+AC_INIT(collectd, 4.0.4)
 AC_CONFIG_SRCDIR(src/collectd.c)
 AC_CONFIG_HEADERS(src/config.h)
 AM_INIT_AUTOMAKE(dist-bzip2)
@@ -332,7 +332,12 @@ AC_CHECK_HEADERS(net/if_arp.h, [], [],
 # include <sys/socket.h>
 #endif
 ])
-AC_CHECK_HEADERS(net/if_ppp.h)
+AC_CHECK_HEADERS(net/ppp_defs.h)
+AC_CHECK_HEADERS(net/if_ppp.h, [], [],
+[#if HAVE_NET_PPP_DEFS_H
+# include <net/ppp_defs.h>
+#endif
+])
 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
 [#if HAVE_STDINT_H
 # include <stdint.h>
index 6c40c07..86485ca 100644 (file)
@@ -44,7 +44,7 @@ our %EXPORT_TAGS = (
 
 Exporter::export_ok_tags('all');
 
-bootstrap Collectd "4.0.3";
+bootstrap Collectd "4.0.4";
 
 1;
 
index 534559c..fca9f18 100644 (file)
 #include <sys/un.h>
 
 /*
- * This weird macro cascade forces the glibc to define `NAN'. I don't know
- * another way to solve this, so more intelligent solutions are welcome. -octo
+ * This is copied directly from collectd.h. Make changes there!
  */
-#ifndef __USE_ISOC99
-# define DISABLE__USE_ISOC99 1
-# define __USE_ISOC99 1
-#endif
-#include <math.h>
-#ifdef DISABLE__USE_ISOC99
-# undef DISABLE__USE_ISOC99
-# undef __USE_ISOC99
-#endif
+#if NAN_STATIC_DEFAULT
+# include <math.h>
+/* #endif NAN_STATIC_DEFAULT*/
+#elif NAN_STATIC_ISOC
+# ifndef __USE_ISOC99
+#  define DISABLE_ISOC99 1
+#  define __USE_ISOC99 1
+# endif /* !defined(__USE_ISOC99) */
+# include <math.h>
+# if DISABLE_ISOC99
+#  undef DISABLE_ISOC99
+#  undef __USE_ISOC99
+# endif /* DISABLE_ISOC99 */
+/* #endif NAN_STATIC_ISOC */
+#elif NAN_ZERO_ZERO
+# include <math.h>
+# ifdef NAN
+#  undef NAN
+# endif
+# define NAN (0.0 / 0.0)
+# ifndef isnan
+#  define isnan(f) ((f) != (f))
+# endif /* !defined(isnan) */
+#endif /* NAN_ZERO_ZERO */
 
 #define RET_OKAY     0
 #define RET_WARNING  1
index 4c852a5..cbdde1e 100644 (file)
--- a/src/cpu.c
+++ b/src/cpu.c
@@ -340,7 +340,7 @@ static int cpu_read (void)
        static cpu_stat_t cs;
 
        if (kc == NULL)
-               return;
+               return (-1);
 
        for (cpu = 0; cpu < numcpu; cpu++)
        {
index c439ebd..52b2ddf 100644 (file)
@@ -317,7 +317,7 @@ static int interface_read (void)
        unsigned long long tx;
 
        if (kc == NULL)
-               return;
+               return (-1);
 
        for (i = 0; i < numif; i++)
        {
index 646bbc6..4d9fc3d 100644 (file)
@@ -23,6 +23,7 @@
 #include "parser.h"
 %}
 %option yylineno
+%option noyywrap
 WHITE_SPACE [\ \t\b]
 QUOTED_STRING \"([^\\"]+|\\.)*\"
 UNQUOTED_STRING [0-9A-Za-z_]+
index 5e1d9d3..22872f0 100644 (file)
@@ -88,7 +88,7 @@ static int load_read (void)
                char errbuf[1024];
                WARNING ("load: fopen: %s",
                                sstrerror (errno, errbuf, sizeof (errbuf)));
-               return;
+               return (-1);
        }
 
        if (fgets (buffer, 16, loadavg) == NULL)
@@ -97,7 +97,7 @@ static int load_read (void)
                WARNING ("load: fgets: %s",
                                sstrerror (errno, errbuf, sizeof (errbuf)));
                fclose (loadavg);
-               return;
+               return (-1);
        }
 
        if (fclose (loadavg))
@@ -110,7 +110,7 @@ static int load_read (void)
        numfields = strsplit (buffer, fields, 8);
 
        if (numfields < 3)
-               return;
+               return (-1);
 
        snum = atof (fields[0]);
        mnum = atof (fields[1]);
index 2acb412..cb7e688 100644 (file)
@@ -305,7 +305,7 @@ static int memory_read (void)
 
        memory_submit ("used",   mem_used);
        memory_submit ("free",   mem_free);
-       memory_submit ("locked", mem_locked);
+       memory_submit ("locked", mem_lock);
 /* #endif defined(HAVE_LIBKSTAT) */
 
 #elif defined(HAVE_LIBSTATGRAB)
index 0943727..5834fa1 100644 (file)
@@ -63,6 +63,9 @@
 #if HAVE_NETINET_IF_ETHER_H
 # include <netinet/if_ether.h>
 #endif
+#if HAVE_NET_PPP_DEFS_H
+# include <net/ppp_defs.h>
+#endif
 #if HAVE_NET_IF_PPP_H
 # include <net/if_ppp.h>
 #endif