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)
1  2 
configure.in
src/network.c
src/nfs.c
src/rrdcached.c

diff --combined configure.in
@@@ -49,13 -49,6 +49,13 @@@ AC_PROG_YAC
  PKG_PROG_PKG_CONFIG
  
  AC_CHECK_PROG([have_protoc_c], [protoc-c], [yes], [no])
 +AC_CHECK_HEADERS([google/protobuf-c/protobuf-c.h],
 +                 [have_protobuf_c_h="yes"],
 +                 [have_protobuf_c_h="no"])
 +if test "x$have_protoc_c" = "xyes" && test "x$have_protobuf_c_h" != "xyes"
 +then
 +      have_protoc_c="no (unable to find <google/protobuf-c/protobuf-c.h>)"
 +fi
  AM_CONDITIONAL(HAVE_PROTOC_C, test "x$have_protoc_c" = "xyes")
  
  AC_MSG_CHECKING([for kernel type ($host_os)])
@@@ -135,7 -128,7 +135,7 @@@ AC_HEADER_SYS_WAI
  AC_HEADER_DIRENT
  AC_HEADER_STDBOOL
  
 -AC_CHECK_HEADERS(stdio.h errno.h math.h stdarg.h syslog.h fcntl.h signal.h assert.h sys/types.h sys/socket.h sys/select.h poll.h netdb.h arpa/inet.h sys/resource.h sys/param.h kstat.h regex.h sys/ioctl.h endian.h sys/isa_defs.h)
 +AC_CHECK_HEADERS(stdio.h errno.h math.h stdarg.h syslog.h fcntl.h signal.h assert.h sys/types.h sys/socket.h sys/select.h poll.h netdb.h arpa/inet.h sys/resource.h sys/param.h kstat.h regex.h sys/ioctl.h endian.h sys/isa_defs.h fnmatch.h libgen.h)
  
  # For ping library
  AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
@@@ -277,19 -270,7 +277,19 @@@ if test "x$ac_system" = "xDarwin
  then
        AC_CHECK_HEADERS(mach/mach_init.h mach/host_priv.h mach/mach_error.h mach/mach_host.h mach/mach_port.h mach/mach_types.h mach/message.h mach/processor_set.h mach/processor.h mach/processor_info.h mach/task.h mach/thread_act.h mach/vm_region.h mach/vm_map.h mach/vm_prot.h mach/vm_statistics.h mach/kern_return.h)
        AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
 +      # For the battery plugin
 +      AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
 +[
 +#if HAVE_IOKIT_IOKITLIB_H
 +#  include <IOKit/IOKitLib.h>
 +#endif
 +#if HAVE_IOKIT_IOTYPES_H
 +#  include <IOKit/IOTypes.h>
 +#endif
 +])
 +
  fi
 +
  AC_CHECK_HEADERS(sys/sysctl.h, [], [],
  [
  #if HAVE_SYS_TYPES_H
@@@ -317,7 -298,7 +317,7 @@@ els
  fi
  
  # For hddtemp module
 -AC_CHECK_HEADERS(linux/major.h libgen.h)
 +AC_CHECK_HEADERS(linux/major.h)
  
  # For md module (Linux only)
  if test "x$ac_system" = "xLinux"
@@@ -334,6 -315,17 +334,6 @@@ els
        have_linux_raid_md_u_h="no"
  fi
  
 -# For the battery plugin
 -AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
 -[
 -#if HAVE_IOKIT_IOKITLIB_H
 -#  include <IOKit/IOKitLib.h>
 -#endif
 -#if HAVE_IOKIT_IOTYPES_H
 -#  include <IOKit/IOTypes.h>
 -#endif
 -])
 -
  # For the swap module
  have_linux_wireless_h="no"
  if test "x$ac_system" = "xLinux"
@@@ -591,12 -583,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;
          dummy = NULL;
          printf ("token = %s;\n", token);
        }
-     ]]])],
+ ]]]
+     )],
      [c_cv_have_strtok_r_default="yes"],
      [c_cv_have_strtok_r_default="no"]
    )
@@@ -623,12 -616,12 +624,12 @@@ the
      [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;
            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 -713,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 -729,7 +737,7 @@@ if test "x$have_strptime" = "xyes" && t
  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
  #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 -762,6 +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 -769,17 +777,17 @@@ if test "x$have_swapctl" = "xyes"; the
          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"]
                  [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 -833,19 +841,19 @@@ AC_ARG_WITH(nan-emulation, [AS_HELP_STR
  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"]
      )
  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 -886,8 +894,8 @@@ if test "x$nan_type" = "xnone"; the
    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
  # 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 -947,8 +955,8 @@@ fi; fi; f
  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>
  #if HAVE_STDBOOL_H
  # include <stdbool.h>
  #endif
      ]]],
      [[[
+ ]]],
+ [[[
        uint64_t i0;
        uint64_t i1;
        uint8_t c[8];
                return (0);
        else
                return (1);
-       ]]])],
+ ]]]
+       )],
        [c_cv_fp_layout_need_nothing="yes"],
        [c_cv_fp_layout_need_nothing="no"]
      )
  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>
                         (((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];
                return (0);
        else
                return (1);
-       ]]])],
+ ]]]
+       )],
        [c_cv_fp_layout_need_endianflip="yes"],
        [c_cv_fp_layout_need_endianflip="no"]
      )
  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>
  #endif
  #define intswap(A)    ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
                         (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
      ]]],
      [[[
+ ]]],
+ [[[
        uint64_t i0;
        uint64_t i1;
        uint8_t c[8];
                return (0);
        else
                return (1);
-       ]]])],
+ ]]]
+       )],
        [c_cv_fp_layout_need_intswap="yes"],
        [c_cv_fp_layout_need_intswap="no"]
      )
@@@ -1141,15 -1133,15 +1141,15 @@@ if test "x$have_getmntent" = "xc"; the
                [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"]
                [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"]
  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.])
      ])
@@@ -1842,8 -1836,6 +1844,8 @@@ the
  
        if test "$with_libgcrypt" != "no"; then
                AM_PATH_LIBGCRYPT(1:1.2.0,,with_libgcrypt="no (version 1.2.0+ required)")
 +              GCRYPT_CPPFLAGS="$LIBGCRYPT_CPPFLAGS"
 +              GCRYPT_LIBS="$LIBGCRYPT_LIBS"
        fi
  fi
  
        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
                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])
                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])
  #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 -2538,7 +2548,7 @@@ the
                [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>
  #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"]
                [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>
  #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 -3053,20 +3063,20 @@@ dnl ARCHFLAGS="" -> disable multi -arc
  
    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 -3098,8 +3108,8 @@@ the
  
        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>
  #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"]
                )
  
        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"]
                )
@@@ -4954,7 -4946,7 +4956,7 @@@ AC_PLUGIN([oracle],      [$with_oracle]
  AC_PLUGIN([perl],        [$plugin_perl],       [Embed a Perl interpreter])
  AC_PLUGIN([pf],          [$have_net_pfvar_h],  [BSD packet filter (PF) statistics])
  # FIXME: Check for libevent, too.
 -AC_PLUGIN([pinba],       [$have_protoc_c],     [Pinba statistics])
 +AC_PLUGIN([pinba],       [$have_protobuf_c_h], [Pinba statistics])
  AC_PLUGIN([ping],        [$with_liboping],     [Network latency statistics])
  AC_PLUGIN([postgresql],  [$with_libpq],        [PostgreSQL database statistics])
  AC_PLUGIN([powerdns],    [yes],                [PowerDNS statistics])
@@@ -4972,7 -4964,6 +4974,7 @@@ AC_PLUGIN([swap],        [$plugin_swap]
  AC_PLUGIN([syslog],      [$have_syslog],       [Syslog logging plugin])
  AC_PLUGIN([table],       [yes],                [Parsing of tabular data])
  AC_PLUGIN([tail],        [yes],                [Parsing of logfiles])
 +AC_PLUGIN([tail_csv],    [yes],                [Parsing of CSV files])
  AC_PLUGIN([tape],        [$plugin_tape],       [Tape drive statistics])
  AC_PLUGIN([target_notification], [yes],        [The notification target])
  AC_PLUGIN([target_replace], [yes],             [The replace target])
@@@ -4995,9 -4986,8 +4997,9 @@@ AC_PLUGIN([vserver],     [$plugin_vserv
  AC_PLUGIN([wireless],    [$plugin_wireless],   [Wireless statistics])
  AC_PLUGIN([write_graphite], [yes],             [Graphite / Carbon output plugin])
  AC_PLUGIN([write_http],  [$with_libcurl],      [HTTP output plugin])
 -AC_PLUGIN([write_redis], [$with_libcredis],    [Redis output plugin])
  AC_PLUGIN([write_mongodb], [$with_libmongoc],  [MongoDB output plugin])
 +AC_PLUGIN([write_redis], [$with_libcredis],    [Redis output plugin])
 +AC_PLUGIN([write_riemann], [$have_protobuf_c_h], [Riemann output plugin])
  AC_PLUGIN([xmms],        [$with_libxmms],      [XMMS statistics])
  AC_PLUGIN([zfs_arc],     [$plugin_zfs_arc],    [ZFS ARC statistics])
  
@@@ -5094,6 -5084,7 +5096,7 @@@ the
  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"
                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"
@@@ -5307,7 -5296,6 +5308,7 @@@ Configuration
      syslog  . . . . . . . $enable_syslog
      table . . . . . . . . $enable_table
      tail  . . . . . . . . $enable_tail
 +    tail_csv  . . . . . . $enable_tail_csv
      tape  . . . . . . . . $enable_tape
      target_notification . $enable_target_notification
      target_replace  . . . $enable_target_replace
      wireless  . . . . . . $enable_wireless
      write_graphite  . . . $enable_write_graphite
      write_http  . . . . . $enable_write_http
 -    write_redis . . . . . $enable_write_redis
      write_mongodb . . . . $enable_write_mongodb
 +    write_redis . . . . . $enable_write_redis
 +    write_riemann . . . . $enable_write_riemann
      xmms  . . . . . . . . $enable_xmms
      zfs_arc . . . . . . . $enable_zfs_arc
  
diff --combined src/network.c
@@@ -1,6 -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 +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>
   **/
  
@@@ -460,7 -460,7 +460,7 @@@ static int network_dispatch_values (val
      }
    }
  
 -  plugin_dispatch_values_secure (vl);
 +  plugin_dispatch_values (vl);
    stats_values_dispatched++;
  
    meta_data_destroy (vl->meta);
@@@ -493,6 -493,20 +493,20 @@@ static int network_dispatch_notificatio
  } /* }}} 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 +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))
                        {
        {
                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 "
@@@ -3318,13 -3336,13 +3336,13 @@@ static int network_stats_read (void) /
        vl.values[0].derive = (derive_t) copy_octets_rx;
        vl.values[1].derive = (derive_t) copy_octets_tx;
        sstrncpy (vl.type, "if_octets", sizeof (vl.type));
 -      plugin_dispatch_values_secure (&vl);
 +      plugin_dispatch_values (&vl);
  
        /* Packets received / send */
        vl.values[0].derive = (derive_t) copy_packets_rx;
        vl.values[1].derive = (derive_t) copy_packets_tx;
        sstrncpy (vl.type, "if_packets", sizeof (vl.type));
 -      plugin_dispatch_values_secure (&vl);
 +      plugin_dispatch_values (&vl);
  
        /* Values (not) dispatched and (not) send */
        sstrncpy (vl.type, "total_values", sizeof (vl.type));
        vl.values[0].derive = (derive_t) copy_values_dispatched;
        sstrncpy (vl.type_instance, "dispatch-accepted",
                        sizeof (vl.type_instance));
 -      plugin_dispatch_values_secure (&vl);
 +      plugin_dispatch_values (&vl);
  
        vl.values[0].derive = (derive_t) copy_values_not_dispatched;
        sstrncpy (vl.type_instance, "dispatch-rejected",
                        sizeof (vl.type_instance));
 -      plugin_dispatch_values_secure (&vl);
 +      plugin_dispatch_values (&vl);
  
        vl.values[0].derive = (derive_t) copy_values_sent;
        sstrncpy (vl.type_instance, "send-accepted",
                        sizeof (vl.type_instance));
 -      plugin_dispatch_values_secure (&vl);
 +      plugin_dispatch_values (&vl);
  
        vl.values[0].derive = (derive_t) copy_values_not_sent;
        sstrncpy (vl.type_instance, "send-rejected",
                        sizeof (vl.type_instance));
 -      plugin_dispatch_values_secure (&vl);
 +      plugin_dispatch_values (&vl);
  
        /* Receive queue length */
        vl.values[0].gauge = (gauge_t) copy_receive_list_length;
        sstrncpy (vl.type, "queue_length", sizeof (vl.type));
        vl.type_instance[0] = 0;
 -      plugin_dispatch_values_secure (&vl);
 +      plugin_dispatch_values (&vl);
  
        return (0);
  } /* }}} int network_stats_read */
@@@ -3370,17 -3388,7 +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)
diff --combined src/nfs.c
+++ b/src/nfs.c
@@@ -1,6 -1,7 +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 +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>
   **/
  
@@@ -246,7 -247,7 +247,7 @@@ static void nfs_procedures_submit (cons
                vl.values = values + i;
                sstrncpy (vl.type_instance, type_instances[i],
                                sizeof (vl.type_instance));
 -              plugin_dispatch_values_secure (&vl);
 +              plugin_dispatch_values (&vl);
        }
  } /* void nfs_procedures_submit */
  
@@@ -318,7 -319,7 +319,7 @@@ static void nfs_read_linux (FILE *fh, c
  
  #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];
  
        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);
diff --combined src/rrdcached.c
@@@ -1,6 -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
@@@ -46,9 -46,7 +46,9 @@@ static rrdcreate_config_t rrdcreate_con
        /* timespans_num = */ 0,
  
        /* consolidation_functions = */ NULL,
 -      /* consolidation_functions_num = */ 0
 +      /* consolidation_functions_num = */ 0,
 +
 +      /* async = */ 0
  };
  
  /*
@@@ -252,8 -250,6 +252,8 @@@ static int rc_config (oconfig_item_t *c
        status = cf_util_get_string (child, &daemon_address);
      else if (strcasecmp ("CreateFiles", key) == 0)
        status = cf_util_get_boolean (child, &config_create_files);
 +    else if (strcasecmp ("CreateFilesAsync", key) == 0)
 +      status = cf_util_get_boolean (child, &rrdcreate_config.async);
      else if (strcasecmp ("CollectStatistics", key) == 0)
        status = cf_util_get_boolean (child, &config_collect_stats);
      else if (strcasecmp ("StepSize", key) == 0)
@@@ -320,6 -316,14 +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)
@@@ -463,8 -467,6 +471,8 @@@ static int rc_write (const data_set_t *
              filename);
          return (-1);
        }
 +      else if (rrdcreate_config.async)
 +        return (0);
      }
    }