From: Florian Forster Date: Sun, 24 Jun 2007 20:42:09 +0000 (+0200) Subject: Merge branch 'collectd-4.0' X-Git-Tag: collectd-4.1.0~43 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=dd13e59199e95dfa5421ca33907c0cccc75e550c;hp=653d8334c5085f7559f3b12438c8636210e66701;p=collectd.git Merge branch 'collectd-4.0' --- diff --git a/ChangeLog b/ChangeLog index 79c117ea..2d05d35d 100644 --- 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. diff --git a/configure.in b/configure.in index 2914b5ac..cf423edc 100644 --- a/configure.in +++ b/configure.in @@ -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 #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 +#endif +]) AC_CHECK_HEADERS(netinet/if_ether.h, [], [], [#if HAVE_STDINT_H # include diff --git a/contrib/PerlLib/Collectd.pm b/contrib/PerlLib/Collectd.pm index 6c40c073..86485ca7 100644 --- a/contrib/PerlLib/Collectd.pm +++ b/contrib/PerlLib/Collectd.pm @@ -44,7 +44,7 @@ our %EXPORT_TAGS = ( Exporter::export_ok_tags('all'); -bootstrap Collectd "4.0.3"; +bootstrap Collectd "4.0.4"; 1; diff --git a/src/collectd-nagios.c b/src/collectd-nagios.c index 534559ce..fca9f18c 100644 --- a/src/collectd-nagios.c +++ b/src/collectd-nagios.c @@ -11,18 +11,32 @@ #include /* - * 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 -#ifdef DISABLE__USE_ISOC99 -# undef DISABLE__USE_ISOC99 -# undef __USE_ISOC99 -#endif +#if NAN_STATIC_DEFAULT +# include +/* #endif NAN_STATIC_DEFAULT*/ +#elif NAN_STATIC_ISOC +# ifndef __USE_ISOC99 +# define DISABLE_ISOC99 1 +# define __USE_ISOC99 1 +# endif /* !defined(__USE_ISOC99) */ +# include +# if DISABLE_ISOC99 +# undef DISABLE_ISOC99 +# undef __USE_ISOC99 +# endif /* DISABLE_ISOC99 */ +/* #endif NAN_STATIC_ISOC */ +#elif NAN_ZERO_ZERO +# include +# 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 diff --git a/src/cpu.c b/src/cpu.c index 4c852a53..cbdde1ec 100644 --- 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++) { diff --git a/src/interface.c b/src/interface.c index c439ebd6..52b2ddf0 100644 --- a/src/interface.c +++ b/src/interface.c @@ -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++) { diff --git a/src/liboconfig/scanner.l b/src/liboconfig/scanner.l index 646bbc63..4d9fc3de 100644 --- a/src/liboconfig/scanner.l +++ b/src/liboconfig/scanner.l @@ -23,6 +23,7 @@ #include "parser.h" %} %option yylineno +%option noyywrap WHITE_SPACE [\ \t\b] QUOTED_STRING \"([^\\"]+|\\.)*\" UNQUOTED_STRING [0-9A-Za-z_]+ diff --git a/src/load.c b/src/load.c index 5e1d9d30..22872f04 100644 --- a/src/load.c +++ b/src/load.c @@ -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]); diff --git a/src/memory.c b/src/memory.c index 2acb4121..cb7e6882 100644 --- a/src/memory.c +++ b/src/memory.c @@ -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) diff --git a/src/utils_dns.c b/src/utils_dns.c index 09437275..5834fa13 100644 --- a/src/utils_dns.c +++ b/src/utils_dns.c @@ -63,6 +63,9 @@ #if HAVE_NETINET_IF_ETHER_H # include #endif +#if HAVE_NET_PPP_DEFS_H +# include +#endif #if HAVE_NET_IF_PPP_H # include #endif