Merge branch 'collectd-4.6'
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 11 Apr 2009 07:37:30 +0000 (09:37 +0200)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 11 Apr 2009 07:37:30 +0000 (09:37 +0200)
configure.in
src/collectd-unixsock.pod
src/collectd.h
src/dbi.c
src/exec.c
src/network.c

index 3540a3e..f0c4312 100644 (file)
@@ -2108,8 +2108,9 @@ if test "x$with_libperl" = "xyes" \
 then
   SAVE_CFLAGS=$CFLAGS
   SAVE_LDFLAGS=$LDFLAGS
-  PERL_CFLAGS=`$perl_interpreter -MExtUtils::Embed -e ccopts`
-  PERL_LDFLAGS=`$perl_interpreter -MExtUtils::Embed -e ldopts`
+dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
+  PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
+  PERL_LDFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
   CFLAGS="$CFLAGS $PERL_CFLAGS"
   LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
 
index ac4a1b1..83802a1 100644 (file)
@@ -131,10 +131,10 @@ Example:
 Submits a notification to the daemon which will then dispatch it to all plugins
 which have registered for receiving notifications. 
 
-The B<PUTNOTIF> if followed by a list of options which further describe the
-notification. The B<message> option is special in that it will consume the rest
-of the line as its value. The B<message>, B<severity>, and B<time> options are
-mandatory.
+The B<PUTNOTIF> command is followed by a list of options which further describe
+the notification. The B<message> option is special in that it will consume the
+rest of the line as its value. The B<message>, B<severity>, and B<time> options
+are mandatory.
 
 Valid options are:
 
@@ -195,7 +195,7 @@ callback will be flushed.
 
 If the B<identifier> option is given only the specified values will be flushed.
 This is meant to be used by graphing or displaying frontends which want to have
-the lastest values for a specific graph. Again, you can specify the
+the latest values for a specific graph. Again, you can specify the
 B<identifier> option multiple times to flush several values. If this option is
 not specified at all, all values will be flushed.
 
index 277a610..18052ba 100644 (file)
 #  define BYTE_ORDER _BYTE_ORDER
 # elif defined(__BYTE_ORDER)
 #  define BYTE_ORDER __BYTE_ORDER
+# elif defined(__DARWIN_BYTE_ORDER)
+#  define BYTE_ORDER __DARWIN_BYTE_ORDER
 # endif
 #endif
 #ifndef BIG_ENDIAN
 #  define BIG_ENDIAN _BIG_ENDIAN
 # elif defined(__BIG_ENDIAN)
 #  define BIG_ENDIAN __BIG_ENDIAN
+# elif defined(__DARWIN_BIG_ENDIAN)
+#  define BIG_ENDIAN __DARWIN_BIG_ENDIAN
 # endif
 #endif
 #ifndef LITTLE_ENDIAN
 #  define LITTLE_ENDIAN _LITTLE_ENDIAN
 # elif defined(__LITTLE_ENDIAN)
 #  define LITTLE_ENDIAN __LITTLE_ENDIAN
+# elif defined(__DARWIN_LITTLE_ENDIAN)
+#  define LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN
 # endif
 #endif
 #ifndef BYTE_ORDER
index 5be9cae..ce4cd02 100644 (file)
--- a/src/dbi.c
+++ b/src/dbi.c
@@ -126,10 +126,19 @@ static int cdbi_result_get_field (dbi_result res, /* {{{ */
     else
       sstrncpy (buffer, value, buffer_size);
   }
+  /* DBI_TYPE_BINARY */
+  /* DBI_TYPE_DATETIME */
   else
   {
-    ERROR ("dbi plugin: cdbi_result_get: Don't know how to handle "
-        "source type %hu.", src_type);
+    const char *field_name;
+
+    field_name = dbi_result_get_field_name (res, index);
+    if (field_name == NULL)
+      field_name = "<unknown>";
+
+    ERROR ("dbi plugin: Column `%s': Don't know how to handle "
+        "source type %hu.",
+        field_name, src_type);
     return (-1);
   }
 
index cdcf6ad..82aeb29 100644 (file)
@@ -585,7 +585,17 @@ static void *exec_read_one (void *arg) /* {{{ */
         if (errno == EAGAIN || errno == EINTR)  continue;
         break;
       }
-      else if (len == 0) break;  /* We've reached EOF */
+      else if (len == 0)
+      {
+       /* We've reached EOF */
+       NOTICE ("exec plugin: Program `%s' has closed STDERR.",
+           pl->exec);
+       close (fd_err);
+       FD_CLR (fd_err, &fdset);
+       highest_fd = fd;
+       fd_err = -1;
+       continue;
+      }
 
       pbuffer_err[len] = '\0';
 
@@ -615,6 +625,7 @@ static void *exec_read_one (void *arg) /* {{{ */
     copy = fdset;
   }
 
+  DEBUG ("exec plugin: exec_read_one: Waiting for `%s' to exit.", pl->exec);
   if (waitpid (pl->pid, &status, 0) > 0)
     pl->status = status;
 
@@ -628,7 +639,8 @@ static void *exec_read_one (void *arg) /* {{{ */
   pthread_mutex_unlock (&pl_lock);
 
   close (fd);
-  close (fd_err);
+  if (fd_err >= 0)
+    close (fd_err);
 
   pthread_exit ((void *) 0);
   return (NULL);
index bbe6b6f..51b9922 100644 (file)
@@ -1130,11 +1130,12 @@ static void free_sockent (sockent_t *se) /* {{{ */
  */
 static int network_set_ttl (const sockent_t *se, const struct addrinfo *ai)
 {
+       DEBUG ("network plugin: network_set_ttl: network_config_ttl = %i;",
+                       network_config_ttl);
+
        if ((network_config_ttl < 1) || (network_config_ttl > 255))
                return (-1);
 
-       DEBUG ("ttl = %i", network_config_ttl);
-
        if (ai->ai_family == AF_INET)
        {
                struct sockaddr_in *addr = (struct sockaddr_in *) ai->ai_addr;