Code

Merge branch 'collectd-5.2'
authorFlorian Forster <octo@collectd.org>
Sun, 7 Apr 2013 04:17:49 +0000 (06:17 +0200)
committerFlorian Forster <octo@collectd.org>
Sun, 7 Apr 2013 04:17:49 +0000 (06:17 +0200)
bindings/Makefile.am
configure.in
src/filter_chain.c
src/libcollectdclient/network_buffer.c
src/mysql.c
src/network.c
src/nfs.c
src/notify_email.c
src/rrdcached.c
src/thermal.c
src/utils_parse_option.c

index 50cd727fc9030be20efd30f3b856c8c0baf814e7..07373e87a62bd67c66cee878c0c389ab8e6d1e2d 100644 (file)
@@ -45,7 +45,13 @@ perl: buildperl/Makefile
 
 buildperl/Makefile: .perl-directory-stamp buildperl/Makefile.PL \
        $(top_builddir)/config.status
-       cd buildperl && @PERL@ Makefile.PL INSTALL_BASE=$(DESTDIR)$(prefix) @PERL_BINDINGS_OPTIONS@
+       @# beautify the output a bit
+       @echo 'cd buildperl && @PERL@ Makefile.PL @PERL_BINDINGS_OPTIONS@'
+       @cd buildperl && ( if ! @PERL@ Makefile.PL @PERL_BINDINGS_OPTIONS@; then \
+                       echo ""; \
+                       echo 'Check whether you have set $$PERL_MM_OPT in your environment and try using ./configure --with-perl-bindings=""'; \
+                       echo ""; \
+               fi )
 
 buildperl/Makefile.PL: .perl-directory-stamp $(top_builddir)/config.status
 
index 6f1cc599fc2ac00516f1c08cb79025c68078efc5..8ca5d0184abe606c59f8b7aea6e47aabae6e708f 100644 (file)
@@ -591,12 +591,12 @@ AC_CACHE_CHECK([for strtok_r],
   [c_cv_have_strtok_r_default],
   AC_LINK_IFELSE(
     [AC_LANG_PROGRAM(
-    [[[
+[[[
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-    ]]],
-    [[[
+]]],
+[[[
       char buffer[] = "foo,bar,baz";
       char *token;
       char *dummy;
@@ -609,7 +609,8 @@ AC_CACHE_CHECK([for strtok_r],
         dummy = NULL;
         printf ("token = %s;\n", token);
       }
-    ]]])],
+]]]
+    )],
     [c_cv_have_strtok_r_default="yes"],
     [c_cv_have_strtok_r_default="no"]
   )
@@ -623,12 +624,12 @@ then
     [c_cv_have_strtok_r_reentrant],
     AC_LINK_IFELSE(
       [AC_LANG_PROGRAM(
-      [[[
+[[[
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-      ]]],
-      [[[
+]]],
+[[[
         char buffer[] = "foo,bar,baz";
         char *token;
         char *dummy;
@@ -641,7 +642,8 @@ then
           dummy = NULL;
           printf ("token = %s;\n", token);
         }
-      ]]])],
+]]]
+      )],
       [c_cv_have_strtok_r_reentrant="yes"],
       [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
     )
@@ -719,15 +721,15 @@ if test "x$have_strptime" = "xyes"
 then
        AC_CACHE_CHECK([whether strptime is exported by default],
                       [c_cv_have_strptime_default],
-                      AC_COMPILE_IFELSE(
-[AC_LANG_PROGRAM(
+                      AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
 [[[
 #include <time.h>
 ]]],
 [[[
  struct tm stm;
  (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
-]]])],
+]]]
+                      )],
                       [c_cv_have_strptime_default="yes"],
                       [c_cv_have_strptime_default="no"]))
 fi
@@ -735,8 +737,7 @@ if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno
 then
        AC_CACHE_CHECK([whether strptime needs standards mode],
                       [c_cv_have_strptime_standards],
-                      AC_COMPILE_IFELSE(
-[AC_LANG_PROGRAM(
+                      AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
 [[[
 #ifndef _ISOC99_SOURCE
 # define _ISOC99_SOURCE 1
@@ -747,13 +748,13 @@ then
 #ifndef _XOPEN_SOURCE
 # define _XOPEN_SOURCE 500
 #endif
-
 #include <time.h>
 ]]],
 [[[
  struct tm stm;
  (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
-]]])],
+]]]
+                      )],
                       [c_cv_have_strptime_standards="yes"],
                       [c_cv_have_strptime_standards="no"]))
 
@@ -769,7 +770,6 @@ if test "x$GCC" = "xyes"
 then
        CFLAGS="$SAVE_CFLAGS"
 fi
-
 # }}} Check for strptime
 
 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
@@ -777,17 +777,17 @@ if test "x$have_swapctl" = "xyes"; then
         AC_CACHE_CHECK([whether swapctl takes two arguments],
                 [c_cv_have_swapctl_two_args],
                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
-[[
+[[[
 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
 #  undef _FILE_OFFSET_BITS
 #  undef _LARGEFILE64_SOURCE
 #endif
 #include <sys/stat.h>
 #include <sys/swap.h>
-]],
-[[
+]]],
+[[[
 int num = swapctl(0, NULL);
-]]
+]]]
                         )],
                         [c_cv_have_swapctl_two_args="yes"],
                         [c_cv_have_swapctl_two_args="no"]
@@ -797,17 +797,17 @@ int num = swapctl(0, NULL);
                 [c_cv_have_swapctl_three_args],
                 AC_COMPILE_IFELSE(
                         [AC_LANG_PROGRAM(
-[[
+[[[
 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
 #  undef _FILE_OFFSET_BITS
 #  undef _LARGEFILE64_SOURCE
 #endif
 #include <sys/stat.h>
 #include <sys/swap.h>
-]],
-[[
+]]],
+[[[
 int num = swapctl(0, NULL, 0);
-]]
+]]]
                         )],
                         [c_cv_have_swapctl_three_args="yes"],
                         [c_cv_have_swapctl_three_args="no"]
@@ -841,19 +841,19 @@ AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated
 if test "x$nan_type" = "xnone"; then
   AC_CACHE_CHECK([whether NAN is defined by default],
     [c_cv_have_nan_default],
-    AC_COMPILE_IFELSE(
-      [AC_LANG_PROGRAM(
-      [[[
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[[
 #include <stdlib.h>
 #include <math.h>
 static double foo = NAN;
-      ]]],
-      [[[
+]]],
+[[[
        if (isnan (foo))
         return 0;
        else
        return 1;
-      ]]])],
+]]]
+      )],
       [c_cv_have_nan_default="yes"],
       [c_cv_have_nan_default="no"]
     )
@@ -866,20 +866,20 @@ fi
 if test "x$nan_type" = "xnone"; then
   AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
     [c_cv_have_nan_isoc],
-    AC_COMPILE_IFELSE(
-      [AC_LANG_PROGRAM(
-      [[[
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[[
 #include <stdlib.h>
 #define __USE_ISOC99 1
 #include <math.h>
 static double foo = NAN;
-      ]]],
-      [[[
+]]],
+[[[
        if (isnan (foo))
         return 0;
        else
        return 1;
-      ]]])],
+]]]
+      )],
       [c_cv_have_nan_isoc="yes"],
       [c_cv_have_nan_isoc="no"]
     )
@@ -894,9 +894,8 @@ if test "x$nan_type" = "xnone"; then
   LDFLAGS="$LDFLAGS -lm"
   AC_CACHE_CHECK([whether NAN can be defined by 0/0],
     [c_cv_have_nan_zero],
-    AC_RUN_IFELSE(
-      [AC_LANG_PROGRAM(
-      [[[
+    AC_RUN_IFELSE([AC_LANG_PROGRAM(
+[[[
 #include <stdlib.h>
 #include <math.h>
 #ifdef NAN
@@ -907,13 +906,14 @@ if test "x$nan_type" = "xnone"; then
 # define isnan(f) ((f) != (f))
 #endif
 static double foo = NAN;
-      ]]],
-      [[[
+]]],
+[[[
        if (isnan (foo))
         return 0;
        else
        return 1;
-      ]]])],
+]]]
+      )],
       [c_cv_have_nan_zero="yes"],
       [c_cv_have_nan_zero="no"]
     )
@@ -955,9 +955,8 @@ fi; fi; fi
 if test "x$fp_layout_type" = "xunknown"; then
   AC_CACHE_CHECK([if doubles are stored in x86 representation],
     [c_cv_fp_layout_need_nothing],
-    AC_RUN_IFELSE(
-      [AC_LANG_PROGRAM(
-      [[[
+    AC_RUN_IFELSE([AC_LANG_PROGRAM(
+[[[
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -970,8 +969,8 @@ if test "x$fp_layout_type" = "xunknown"; then
 #if HAVE_STDBOOL_H
 # include <stdbool.h>
 #endif
-      ]]],
-      [[[
+]]],
+[[[
        uint64_t i0;
        uint64_t i1;
        uint8_t c[8];
@@ -990,7 +989,8 @@ if test "x$fp_layout_type" = "xunknown"; then
                return (0);
        else
                return (1);
-      ]]])],
+]]]
+      )],
       [c_cv_fp_layout_need_nothing="yes"],
       [c_cv_fp_layout_need_nothing="no"]
     )
@@ -1002,9 +1002,8 @@ fi
 if test "x$fp_layout_type" = "xunknown"; then
   AC_CACHE_CHECK([if endianflip converts to x86 representation],
     [c_cv_fp_layout_need_endianflip],
-    AC_RUN_IFELSE(
-      [AC_LANG_PROGRAM(
-      [[[
+    AC_RUN_IFELSE([AC_LANG_PROGRAM(
+[[[
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -1025,8 +1024,8 @@ if test "x$fp_layout_type" = "xunknown"; then
                        (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
                        (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
                        (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
-      ]]],
-      [[[
+]]],
+[[[
        uint64_t i0;
        uint64_t i1;
        uint8_t c[8];
@@ -1045,7 +1044,8 @@ if test "x$fp_layout_type" = "xunknown"; then
                return (0);
        else
                return (1);
-      ]]])],
+]]]
+      )],
       [c_cv_fp_layout_need_endianflip="yes"],
       [c_cv_fp_layout_need_endianflip="no"]
     )
@@ -1057,9 +1057,8 @@ fi
 if test "x$fp_layout_type" = "xunknown"; then
   AC_CACHE_CHECK([if intswap converts to x86 representation],
     [c_cv_fp_layout_need_intswap],
-    AC_RUN_IFELSE(
-      [AC_LANG_PROGRAM(
-      [[[
+    AC_RUN_IFELSE([AC_LANG_PROGRAM(
+[[[
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -1074,8 +1073,8 @@ if test "x$fp_layout_type" = "xunknown"; then
 #endif
 #define intswap(A)    ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
                        (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
-      ]]],
-      [[[
+]]],
+[[[
        uint64_t i0;
        uint64_t i1;
        uint8_t c[8];
@@ -1094,7 +1093,8 @@ if test "x$fp_layout_type" = "xunknown"; then
                return (0);
        else
                return (1);
-      ]]])],
+]]]
+      )],
       [c_cv_fp_layout_need_intswap="yes"],
       [c_cv_fp_layout_need_intswap="no"]
     )
@@ -1141,15 +1141,15 @@ if test "x$have_getmntent" = "xc"; then
                [c_cv_have_one_getmntent],
                AC_COMPILE_IFELSE(
                        [AC_LANG_PROGRAM(
-[[
+[[[
 #include "$srcdir/src/utils_mount.h"
-]],
-[[
+]]],
+[[[
 FILE *fh;
 struct mntent *me;
 fh = setmntent ("/etc/mtab", "r");
 me = getmntent (fh);
-]]
+]]]
                        )],
                        [c_cv_have_one_getmntent="yes"],
                        [c_cv_have_one_getmntent="no"]
@@ -1159,16 +1159,16 @@ me = getmntent (fh);
                [c_cv_have_two_getmntent],
                AC_COMPILE_IFELSE(
                        [AC_LANG_PROGRAM(
-[[
+[[[
 #include "$srcdir/src/utils_mount.h"
-]],
-[[
+]]],
+[[[
                                 FILE *fh;
                                 struct mnttab mt;
                                 int status;
                                 fh = fopen ("/etc/mnttab", "r");
                                 status = getmntent (fh, &mt);
-]]
+]]]
                        )],
                        [c_cv_have_two_getmntent="yes"],
                        [c_cv_have_two_getmntent="no"]
@@ -1205,17 +1205,19 @@ fi
 AC_MSG_CHECKING([if have htonll defined])
 
     have_htonll="no"
-    AC_LINK_IFELSE([
-       AC_LANG_PROGRAM([[[
+    AC_LINK_IFELSE([AC_LANG_PROGRAM(
+[[[
 #include <sys/types.h>
 #include <netinet/in.h>
 #if HAVE_INTTYPES_H
 # include <inttypes.h>
 #endif
-       ]]], [[[
+]]],
+[[[
           return htonll(0);
-       ]]])
-    ], [
+]]]
+    )],
+    [
       have_htonll="yes"
       AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
     ])
@@ -2007,31 +2009,31 @@ then
        if test -d "$with_java_home"
        then
                AC_MSG_CHECKING([for jni.h])
-               TMPDIR=`find "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
-               if test "x$TMPDIR" != "x"
+               TMPVAR=`find "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
+               if test "x$TMPVAR" != "x"
                then
-                       AC_MSG_RESULT([found in $TMPDIR])
-                       JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
+                       AC_MSG_RESULT([found in $TMPVAR])
+                       JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
                else
                        AC_MSG_RESULT([not found])
                fi
 
                AC_MSG_CHECKING([for jni_md.h])
-               TMPDIR=`find "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
-               if test "x$TMPDIR" != "x"
+               TMPVAR=`find "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
+               if test "x$TMPVAR" != "x"
                then
-                       AC_MSG_RESULT([found in $TMPDIR])
-                       JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
+                       AC_MSG_RESULT([found in $TMPVAR])
+                       JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
                else
                        AC_MSG_RESULT([not found])
                fi
 
                AC_MSG_CHECKING([for libjvm.so])
-               TMPDIR=`find "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
-               if test "x$TMPDIR" != "x"
+               TMPVAR=`find "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
+               if test "x$TMPVAR" != "x"
                then
-                       AC_MSG_RESULT([found in $TMPDIR])
-                       JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPDIR -Wl,-rpath -Wl,$TMPDIR"
+                       AC_MSG_RESULT([found in $TMPVAR])
+                       JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPVAR -Wl,-rpath -Wl,$TMPVAR"
                else
                        AC_MSG_RESULT([not found])
                fi
@@ -2039,10 +2041,10 @@ then
                if test "x$JAVAC" = "x"
                then
                        AC_MSG_CHECKING([for javac])
-                       TMPDIR=`find "$with_java_home" -name javac -type f 2>/dev/null | head -n 1`
-                       if test "x$TMPDIR" != "x"
+                       TMPVAR=`find "$with_java_home" -name javac -type f 2>/dev/null | head -n 1`
+                       if test "x$TMPVAR" != "x"
                        then
-                               JAVAC="$TMPDIR"
+                               JAVAC="$TMPVAR"
                                AC_MSG_RESULT([$JAVAC])
                        else
                                AC_MSG_RESULT([not found])
@@ -2051,10 +2053,10 @@ then
                if test "x$JAR" = "x"
                then
                        AC_MSG_CHECKING([for jar])
-                       TMPDIR=`find "$with_java_home" -name jar -type f 2>/dev/null | head -n 1`
-                       if test "x$TMPDIR" != "x"
+                       TMPVAR=`find "$with_java_home" -name jar -type f 2>/dev/null | head -n 1`
+                       if test "x$TMPVAR" != "x"
                        then
-                               JAR="$TMPDIR"
+                               JAR="$TMPVAR"
                                AC_MSG_RESULT([$JAR])
                        else
                                AC_MSG_RESULT([not found])
@@ -2497,34 +2499,34 @@ then
 #include <sys/socket.h>])
 
         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
-[[
+[[[
 #include <stdio.h>
 #include <sys/types.h>
 #include <asm/types.h>
 #include <sys/socket.h>
 #include <linux/netlink.h>
 #include <linux/rtnetlink.h>
-]],
-[[
+]]],
+[[[
 int retval = TCA_STATS2;
 return (retval);
-]]
+]]]
        )],
        [AC_DEFINE([HAVE_TCA_STATS2], [1], [True if the enum-member TCA_STATS2 exists])])
 
        AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
-[[
+[[[
 #include <stdio.h>
 #include <sys/types.h>
 #include <asm/types.h>
 #include <sys/socket.h>
 #include <linux/netlink.h>
 #include <linux/rtnetlink.h>
-]],
-[[
+]]],
+[[[
 int retval = TCA_STATS;
 return (retval);
-]]
+]]]
        )],
        [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])])
 
@@ -2546,7 +2548,7 @@ then
                [if function 'rtnl_dump_filter' expects five arguments],
                [c_cv_rtnl_dump_filter_five_args],
                AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
-[[
+[[[
 #include <stdio.h>
 #include <sys/types.h>
 #include <asm/types.h>
@@ -2558,12 +2560,12 @@ then
 #elif HAVE_LINUX_LIBNETLINK_H
 # include <linux/libnetlink.h>
 #endif
-]],
-[[
+]]],
+[[[
 if (rtnl_dump_filter(NULL, NULL, NULL, NULL, NULL))
        return 1;
 return 0;
-]]
+]]]
        )],
        [c_cv_rtnl_dump_filter_five_args="yes"],
        [c_cv_rtnl_dump_filter_five_args="no"]
@@ -2574,7 +2576,7 @@ return 0;
                [if function 'rtnl_dump_filter' expects three arguments],
                [c_cv_rtnl_dump_filter_three_args],
                AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
-[[
+[[[
 #include <stdio.h>
 #include <sys/types.h>
 #include <asm/types.h>
@@ -2586,12 +2588,12 @@ return 0;
 #elif HAVE_LINUX_LIBNETLINK_H
 # include <linux/libnetlink.h>
 #endif
-]],
-[[
+]]],
+[[[
 if (rtnl_dump_filter(NULL, NULL, NULL))
        return 1;
 return 0;
-]]
+]]]
        )],
        [c_cv_rtnl_dump_filter_three_args="yes"],
        [c_cv_rtnl_dump_filter_three_args="no"]
@@ -3061,20 +3063,20 @@ dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string
 
   AC_CACHE_CHECK([for libperl],
     [c_cv_have_libperl],
-    AC_LINK_IFELSE(
-      [AC_LANG_PROGRAM(
-      [[[
+    AC_LINK_IFELSE([AC_LANG_PROGRAM(
+[[[
 #define PERL_NO_GET_CONTEXT
 #include <EXTERN.h>
 #include <perl.h>
 #include <XSUB.h>
-      ]]],
-      [[[
+]]],
+[[[
        dTHX;
        load_module (PERL_LOADMOD_NOIMPORT,
                         newSVpv ("Collectd::Plugin::FooBar", 24),
                         Nullsv);
-      ]]])],
+]]]
+      )],
       [c_cv_have_libperl="yes"],
       [c_cv_have_libperl="no"]
     )
@@ -3106,9 +3108,8 @@ then
 
        AC_CACHE_CHECK([if perl supports ithreads],
                [c_cv_have_perl_ithreads],
-               AC_LINK_IFELSE(
-                       [AC_LANG_PROGRAM(
-                       [[[
+               AC_LINK_IFELSE([AC_LANG_PROGRAM(
+[[[
 #include <EXTERN.h>
 #include <perl.h>
 #include <XSUB.h>
@@ -3116,8 +3117,9 @@ then
 #if !defined(USE_ITHREADS)
 # error "Perl does not support ithreads!"
 #endif /* !defined(USE_ITHREADS) */
-                       ]]],
-                       [[[ ]]])],
+]]],
+[[[ ]]]
+                       )],
                        [c_cv_have_perl_ithreads="yes"],
                        [c_cv_have_perl_ithreads="no"]
                )
@@ -3143,20 +3145,20 @@ then
 
        AC_CACHE_CHECK([for broken Perl_load_module()],
                [c_cv_have_broken_perl_load_module],
-               AC_LINK_IFELSE(
-                       [AC_LANG_PROGRAM(
-                       [[[
+               AC_LINK_IFELSE([AC_LANG_PROGRAM(
+[[[
 #define PERL_NO_GET_CONTEXT
 #include <EXTERN.h>
 #include <perl.h>
 #include <XSUB.h>
-                       ]]],
-                       [[[
+]]],
+[[[
                         dTHX;
                         load_module (PERL_LOADMOD_NOIMPORT,
                             newSVpv ("Collectd::Plugin::FooBar", 24),
                             Nullsv);
-                       ]]])],
+]]]
+                       )],
                        [c_cv_have_broken_perl_load_module="no"],
                        [c_cv_have_broken_perl_load_module="yes"]
                )
@@ -5094,6 +5096,7 @@ then
 fi
 
 dnl Perl bindings
+PERL_BINDINGS_OPTIONS="PREFIX=${prefix}"
 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
 [
        if test "x$withval" != "xno" && test "x$withval" != "xyes"
@@ -5101,12 +5104,10 @@ AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@
                PERL_BINDINGS_OPTIONS="$withval"
                with_perl_bindings="yes"
        else
-               PERL_BINDINGS_OPTIONS=""
                with_perl_bindings="$withval"
        fi
 ],
 [
-       PERL_BINDINGS_OPTIONS=""
        if test -n "$perl_interpreter"
        then
                with_perl_bindings="yes"
index ed2df61c9c5b16f35a0e6953ab0f9ca5da03fc8b..7d8369b901def7d9633e78e6c73de5b14cc26f92 100644 (file)
@@ -92,7 +92,7 @@ static void fc_free_matches (fc_match_t *m) /* {{{ */
     (*m->proc.destroy) (&m->user_data);
   else if (m->user_data != NULL)
   {
-    ERROR ("Filter sybsystem: fc_free_matches: There is user data, but no "
+    ERROR ("Filter subsystem: fc_free_matches: There is user data, but no "
         "destroy functions has been specified. "
         "Memory will probably be lost!");
   }
@@ -112,7 +112,7 @@ static void fc_free_targets (fc_target_t *t) /* {{{ */
     (*t->proc.destroy) (&t->user_data);
   else if (t->user_data != NULL)
   {
-    ERROR ("Filter sybsystem: fc_free_targets: There is user data, but no "
+    ERROR ("Filter subsystem: fc_free_targets: There is user data, but no "
         "destroy functions has been specified. "
         "Memory will probably be lost!");
   }
index acbe93f51c050093ea3214819058049074542298..7b06620479fafb6e369b0e05162a5963b9e44cc7 100644 (file)
@@ -146,6 +146,7 @@ static _Bool have_gcrypt (void) /* {{{ */
 #endif
 } /* }}} _Bool have_gcrypt */
 
+#ifndef HAVE_HTONLL
 static uint64_t htonll (uint64_t val) /* {{{ */
 {
   static int config = 0;
@@ -175,6 +176,7 @@ static uint64_t htonll (uint64_t val) /* {{{ */
 
   return ((((uint64_t) lo) << 32) | ((uint64_t) hi));
 } /* }}} uint64_t htonll */
+#endif
 
 static double htond (double val) /* {{{ */
 {
index 6f2d69abbfd6501b830830f25c27a15b0ed4d5de..d2d0b4bfc57a9ad695b592835cadd4707935fac0 100644 (file)
@@ -58,7 +58,7 @@ struct mysql_database_s /* {{{ */
        _Bool slave_sql_running;
 
        MYSQL *con;
-       int    state;
+       _Bool  is_connected;
 };
 typedef struct mysql_database_s mysql_database_t; /* }}} */
 
@@ -237,30 +237,28 @@ static int mysql_config (oconfig_item_t *ci) /* {{{ */
 
 static MYSQL *getconnection (mysql_database_t *db)
 {
-       if (db->state != 0)
+       if (db->is_connected)
        {
-               int err;
-               if ((err = mysql_ping (db->con)) != 0)
-               {
-                       /* Assured by "mysql_config_database" */
-                       assert (db->instance != NULL);
-                       WARNING ("mysql_ping failed for instance \"%s\": %s",
-                                       db->instance,
-                                       mysql_error (db->con));
-                       db->state = 0;
-               }
-               else
-               {
-                       db->state = 1;
+               int status;
+
+               status = mysql_ping (db->con);
+               if (status == 0)
                        return (db->con);
-               }
+
+               WARNING ("mysql plugin: Lost connection to instance \"%s\": %s",
+                               db->instance, mysql_error (db->con));
        }
+       db->is_connected = 0;
 
-       if ((db->con = mysql_init (db->con)) == NULL)
+       if (db->con == NULL)
        {
-               ERROR ("mysql_init failed: %s", mysql_error (db->con));
-               db->state = 0;
-               return (NULL);
+               db->con = mysql_init (NULL);
+               if (db->con == NULL)
+               {
+                       ERROR ("mysql plugin: mysql_init failed: %s",
+                                       mysql_error (db->con));
+                       return (NULL);
+               }
        }
 
        if (mysql_real_connect (db->con, db->host, db->user, db->pass,
@@ -271,20 +269,18 @@ static MYSQL *getconnection (mysql_database_t *db)
                                (db->database != NULL) ? db->database : "<none>",
                                (db->host != NULL) ? db->host : "localhost",
                                mysql_error (db->con));
-               db->state = 0;
                return (NULL);
        }
-       else
-       {
-               INFO ("mysql plugin: Successfully connected to database %s "
-                               "at server %s (server version: %s, protocol version: %d)",
-                               (db->database != NULL) ? db->database : "<none>",
-                               mysql_get_host_info (db->con),
-                               mysql_get_server_info (db->con),
-                               mysql_get_proto_info (db->con));
-               db->state = 1;
-               return (db->con);
-       }
+
+       INFO ("mysql plugin: Successfully connected to database %s "
+                       "at server %s (server version: %s, protocol version: %d)",
+                       (db->database != NULL) ? db->database : "<none>",
+                       mysql_get_host_info (db->con),
+                       mysql_get_server_info (db->con),
+                       mysql_get_proto_info (db->con));
+
+       db->is_connected = 1;
+       return (db->con);
 } /* static MYSQL *getconnection (mysql_database_t *db) */
 
 static void set_host (mysql_database_t *db, char *buf, size_t buflen)
index 8a5bc6af67a02ce4770a1af14bc82433cc507610..98cb8eba100a8ccf19bb89d9dc39ce81d3f651e9 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * collectd - src/network.c
- * Copyright (C) 2005-2010  Florian octo Forster
+ * Copyright (C) 2005-2013  Florian octo Forster
  * Copyright (C) 2009       Aman Gupta
  *
  * This program is free software; you can redistribute it and/or modify it
@@ -18,7 +18,7 @@
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  *
  * Authors:
- *   Florian octo Forster <octo at verplant.org>
+ *   Florian octo Forster <octo at collectd.org>
  *   Aman Gupta <aman at tmm1.net>
  **/
 
@@ -493,6 +493,20 @@ static int network_dispatch_notification (notification_t *n) /* {{{ */
 } /* }}} int network_dispatch_notification */
 
 #if HAVE_LIBGCRYPT
+static void network_init_gcrypt (void) /* {{{ */
+{
+  /* http://lists.gnupg.org/pipermail/gcrypt-devel/2003-August/000458.html
+   * Because you can't know in a library whether another library has
+   * already initialized the library */
+  if (gcry_control (GCRYCTL_ANY_INITIALIZATION_P))
+    return;
+
+  gcry_check_version (NULL); /* before calling any other functions */
+  gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
+  gcry_control (GCRYCTL_INIT_SECMEM, 32768);
+  gcry_control (GCRYCTL_INITIALIZATION_FINISHED);
+} /* }}} void network_init_gcrypt */
+
 static gcry_cipher_hd_t network_get_aes256_cypher (sockent_t *se, /* {{{ */
     const void *iv, size_t iv_size, const char *username)
 {
@@ -2029,6 +2043,8 @@ static int sockent_open (sockent_t *se) /* {{{ */
        {
                if (se->data.client.security_level > SECURITY_LEVEL_NONE)
                {
+                       network_init_gcrypt ();
+
                        if ((se->data.client.username == NULL)
                                        || (se->data.client.password == NULL))
                        {
@@ -2047,6 +2063,8 @@ static int sockent_open (sockent_t *se) /* {{{ */
        {
                if (se->data.server.security_level > SECURITY_LEVEL_NONE)
                {
+                       network_init_gcrypt ();
+
                        if (se->data.server.auth_file == NULL)
                        {
                                ERROR ("network plugin: Server socket with "
@@ -3370,17 +3388,7 @@ static int network_init (void)
        have_init = 1;
 
 #if HAVE_LIBGCRYPT
-    /* http://lists.gnupg.org/pipermail/gcrypt-devel/2003-August/000458.html
-     * Because you can't know in a library whether another library has
-     * already initialized the library
-     */
-    if (!gcry_control (GCRYCTL_ANY_INITIALIZATION_P))
-    {
-        gcry_check_version(NULL); /* before calling any other functions */
-        gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
-        gcry_control (GCRYCTL_INIT_SECMEM, 32768, 0);
-        gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
-    }
+       network_init_gcrypt ();
 #endif
 
        if (network_config_stats != 0)
index 5c6f620781c59b4c9b284a2f3808a858fa8d4b1f..f5b579e1384e0d8d186c8e5c8ff3c098e48ee15d 100644 (file)
--- a/src/nfs.c
+++ b/src/nfs.c
@@ -1,6 +1,7 @@
 /**
  * collectd - src/nfs.c
  * Copyright (C) 2005,2006  Jason Pepas
+ * Copyright (C) 2012,2013  Florian Forster
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
@@ -17,7 +18,7 @@
  *
  * Authors:
  *   Jason Pepas <cell at ices.utexas.edu>
- *   Florian octo Forster <octo at verplant.org>
+ *   Florian octo Forster <octo at collectd.org>
  *   Cosmin Ioiart <cioiart at gmail.com>
  **/
 
@@ -318,7 +319,7 @@ static void nfs_read_linux (FILE *fh, char *inst)
 
 #if HAVE_LIBKSTAT
 static int nfs_read_kstat (kstat_t *ksp, int nfs_version, char *inst,
-               const char **proc_names, size_t proc_names_num)
+               char const **proc_names, size_t proc_names_num)
 {
        char plugin_instance[DATA_MAX_NAME_LEN];
        value_t values[proc_names_num];
@@ -332,8 +333,14 @@ static int nfs_read_kstat (kstat_t *ksp, int nfs_version, char *inst,
 
        kstat_read(kc, ksp, NULL);
        for (i = 0; i < proc_names_num; i++)
-               values[i].counter = (derive_t) get_kstat_value (ksp,
-                               (char *)proc_names[i]);
+       {
+               /* The name passed to kstat_data_lookup() doesn't have the
+                * "const" modifier, so we need to copy the name here. */
+               char name[32];
+               sstrncpy (name, proc_names[i], sizeof (name));
+
+               values[i].counter = (derive_t) get_kstat_value (ksp, name);
+       }
 
        nfs_procedures_submit (plugin_instance, proc_names, values,
                        proc_names_num);
index cd216ca2da753a2e1a2895486f706c62c280e42d..24c66ec051b965aa5cbfedd228d774430d951c53 100644 (file)
@@ -258,7 +258,7 @@ static int notify_email_notification (const notification_t *n,
   /* Let's make RFC822 message text with \r\n EOLs */
   ssnprintf (buf, buf_len,
       "MIME-Version: 1.0\r\n"
-      "Content-Type: text/plain;\r\n"
+      "Content-Type: text/plain; charset=\"US-ASCII\"\r\n"
       "Content-Transfer-Encoding: 8bit\r\n"
       "Subject: %s\r\n"
       "\r\n"
index 0a9803599520425bd3c640abf5ec1141939379e2..7e0b1e77ef3b523f45eb3a188598a0ee3b8bae2a 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * collectd - src/rrdcached.c
- * Copyright (C) 2008-2012  Florian octo Forster
+ * Copyright (C) 2008-2013  Florian octo Forster
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
@@ -320,6 +320,14 @@ static int rc_read (void)
     sstrncpy (vl.host, daemon_address, sizeof (vl.host));
   sstrncpy (vl.plugin, "rrdcached", sizeof (vl.plugin));
 
+  status = rrdc_connect (daemon_address);
+  if (status != 0)
+  {
+    ERROR ("rrdcached plugin: rrdc_connect (%s) failed with status %i.",
+        daemon_address, status);
+    return (-1);
+  }
+
   head = NULL;
   status = rrdc_stats_get (&head);
   if (status != 0)
index 0ad0d90a04377126132e35cad77e4d592a844a1d..603f85bbf6a96595ee04891127f37006d90730aa 100644 (file)
@@ -55,6 +55,9 @@ static void thermal_submit (const char *plugin_instance, enum dev_type dt,
        v.gauge = value;
        vl.values = &v;
 
+       vl.values_len = 1;
+
+       sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "thermal", sizeof(vl.plugin));
        if (plugin_instance != NULL)
                sstrncpy (vl.plugin_instance, plugin_instance,
index 2168cd1af3d624801146905b853adb0c92db3d7b..820f14f58ef1da32cdfbe73c016c7fefdba4a0b0 100644 (file)
@@ -127,7 +127,7 @@ int parse_option (char **ret_buffer, char **ret_key, char **ret_value)
 
   /* Look for the equal sign */
   buffer = key;
-  while (isalnum ((int) *buffer))
+  while (isalnum ((int) *buffer) || *buffer == '_')
     buffer++;
   if ((*buffer != '=') || (buffer == key))
     return (1);