Merge branch 'collectd-4.1'
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 27 Oct 2007 09:09:25 +0000 (11:09 +0200)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 27 Oct 2007 09:09:25 +0000 (11:09 +0200)
README
configure.in
src/common.c

diff --git a/README b/README
index a2797b8..2406154 100644 (file)
--- a/README
+++ b/README
@@ -325,6 +325,29 @@ Prerequisites
     particular.
 
 
+Configuring / Compiling / Installing
+------------------------------------
+
+  To configure, build and install collectd with the default settings, run
+  `./configure && make && make install'.  For detailed, generic instructions
+  see INSTALL. For a complete list of configure options and their description,
+  run `./configure --help'.
+  
+  By default, the configure script will check for all build dependencies and
+  disable all plugins whose requirements cannot be fulfilled (any other plugin
+  will be enabled). To enable a plugin, install missing dependencies (see
+  section `Prerequisites' above) and rerun `configure'. If you specify the
+  `--enable-<plugin>' configure option, you can force the plugin to be built.
+  This will most likely fail though unless you're working in a very unusual
+  setup and you really know what you're doing.
+
+  By default, collectd will be installed into `/opt/collectd'. You can adjust
+  this setting by specifying the `--prefix' configure option - see INSTALL for
+  details. If you pass DESTDIR=<path> to `make install', <path> will be
+  prefixed to all installation directories. This might be useful when creating
+  packages for collectd.
+
+
 Crosscompiling
 --------------
 
index 0ef4652..74c40f5 100644 (file)
@@ -1299,7 +1299,7 @@ AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Pat
        if test "x$withval" = "xno"
        then
                with_libnetsnmp="no"
-       else if "x$withval" = "xyes"
+       else if test "x$withval" = "xyes"
        then
                with_libnetsnmp="yes"
        else
index 974a29e..1138f96 100644 (file)
@@ -48,6 +48,10 @@ extern kstat_ctl_t *kc;
 static pthread_mutex_t getpwnam_r_lock = PTHREAD_MUTEX_INITIALIZER;
 #endif
 
+#if !HAVE_STRERROR_R
+static pthread_mutex_t strerror_r_lock = PTHREAD_MUTEX_INITIALIZER;
+#endif
+
 void sstrncpy (char *d, const char *s, int len)
 {
        strncpy (d, s, len);
@@ -76,7 +80,21 @@ char *sstrdup (const char *s)
 char *sstrerror (int errnum, char *buf, size_t buflen)
 {
        buf[0] = '\0';
-#ifdef STRERROR_R_CHAR_P
+
+#if !HAVE_STRERROR_R
+       {
+               char *temp;
+
+               pthread_mutex_lock (&strerror_r_lock);
+
+               temp = strerror (errnum);
+               strncpy (buf, temp, buflen);
+
+               pthread_mutex_unlock (&strerror_r_lock);
+       }
+/* #endif !HAVE_STRERROR_R */
+
+#elif STRERROR_R_CHAR_P
        {
                char *temp;
                temp = strerror_r (errnum, buf, buflen);
@@ -87,9 +105,10 @@ char *sstrerror (int errnum, char *buf, size_t buflen)
                        else
                                strncpy (buf, "strerror_r did not return "
                                                "an error message", buflen);
-                       buf[buflen - 1] = '\0';
                }
        }
+/* #endif STRERROR_R_CHAR_P */
+
 #else
        if (strerror_r (errnum, buf, buflen) != 0)
        {
@@ -98,6 +117,7 @@ char *sstrerror (int errnum, char *buf, size_t buflen)
                                errnum);
        }
 #endif /* STRERROR_R_CHAR_P */
+
        buf[buflen - 1] = '\0';
        return (buf);
 } /* char *sstrerror */