Merge branch 'collectd-3.10'
authorFlorian Forster <octo@huhu.verplant.org>
Wed, 19 Jul 2006 16:51:35 +0000 (18:51 +0200)
committerFlorian Forster <octo@huhu.verplant.org>
Wed, 19 Jul 2006 16:51:35 +0000 (18:51 +0200)
1  2 
configure.in
src/apcups.c

diff --combined configure.in
@@@ -1,5 -1,5 +1,5 @@@
  dnl Process this file with autoconf to produce a configure script.
- AC_INIT(collectd, 3.10.0)
+ AC_INIT(collectd, 3.10.1)
  AC_CONFIG_SRCDIR(src/collectd.c)
  AC_CONFIG_HEADERS(src/config.h)
  AM_INIT_AUTOMAKE(dist-bzip2)
@@@ -197,9 -197,6 +197,9 @@@ AC_CHECK_HEADERS(IOKit/storage/IOBlockS
  # For load module
  AC_CHECK_HEADERS(sys/loadavg.h)
  
 +# For the processes plugin
 +AC_CHECK_HEADERS(linux/config.h)
 +
  # For the swap module
  AC_CHECK_HEADERS(sys/swap.h)
  
diff --combined src/apcups.c
@@@ -208,6 -208,7 +208,7 @@@ static int net_open (char *host, char *
        if (status != 0) /* `connect(2)' failed */
        {
                DBG ("connect failed: %s", strerror (errno));
+               close (sd);
                return (-1);
        }
  
@@@ -300,7 -301,7 +301,7 @@@ static int apc_query_server (char *host
        double  value;
  
        static int sockfd   = -1;
 -      static unsigned int complain = 0;
 +      static complain_t compl;
  
  #if APCMAIN
  # define PRINT_VALUE(name, val) printf("  Found property: name = %s; value = %f;\n", name, val)
        {
                if ((sockfd = net_open (host, NULL, port)) < 0)
                {
 -                      /* Complain once every six hours. */
 -                      int complain_step = 21600 / atoi (COLLECTD_STEP);
 -
 -                      if ((complain % complain_step) == 0)
 -                              syslog (LOG_ERR, "apcups plugin: Connecting to the apcupsd failed.");
 -                      complain++;
 -
 +                      plugin_complain (LOG_ERR, &compl, "apcups plugin: "
 +                                      "Connecting to the apcupsd failed.");
                        return (-1);
                }
 -              else if (complain > 1)
 +              else
                {
 -                      syslog (LOG_NOTICE, "apcups plugin: Connection re-established to the apcupsd.");
 -                      complain = 0;
 +                      plugin_relief (LOG_NOTICE, &compl, "apcups plugin: "
 +                                      "Connection re-established to the apcupsd.");
                }
        }