Remove HAVE_PTHREAD_H include guard
[collectd.git] / src / daemon / common.c
index 7b7353d..f82efe3 100644 (file)
@@ -36,9 +36,7 @@
 #include "plugin.h"
 #include "utils_cache.h"
 
-#if HAVE_PTHREAD_H
-# include <pthread.h>
-#endif
+#include <pthread.h>
 
 #ifdef HAVE_MATH_H
 # include <math.h>
@@ -335,7 +333,7 @@ int strjoin (char *buffer, size_t buffer_size,
        size_t sep_len;
        size_t i;
 
-       if ((buffer_size < 1) || (fields_num <= 0))
+       if ((buffer_size < 1) || (fields_num == 0))
                return (-1);
 
        memset (buffer, 0, buffer_size);
@@ -373,27 +371,6 @@ int strjoin (char *buffer, size_t buffer_size,
        return ((int) strlen (buffer));
 }
 
-int strsubstitute (char *str, char c_from, char c_to)
-{
-       int ret;
-
-       if (str == NULL)
-               return (-1);
-
-       ret = 0;
-       while (*str != '\0')
-       {
-               if (*str == c_from)
-               {
-                       *str = c_to;
-                       ret++;
-               }
-               str++;
-       }
-
-       return (ret);
-} /* int strsubstitute */
-
 int escape_string (char *buffer, size_t buffer_size)
 {
   char *temp;