]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
Merge branch 'ff/netlib'
authorFlorian Forster <octo@collectd.org>
Sat, 17 Nov 2012 07:25:01 +0000 (08:25 +0100)
committerFlorian Forster <octo@collectd.org>
Sat, 17 Nov 2012 07:25:01 +0000 (08:25 +0100)
Conflicts:
src/collectdctl.c
src/libcollectdclient/client.c
src/libcollectdclient/collectd/client.h

1  2 
configure.in
src/Makefile.am
src/collectd-nagios.c
src/collectdctl.c
src/libcollectdclient/client.c
src/libcollectdclient/collectd/client.h

diff --cc configure.in
index 4a1597679498a3553d1f66b3316abfd8cf9437a8,af584425ae890d9c9087471de9b8c943e49703d1..7c4ec3a2da07f0ab5d091e32e99e2fced01d0cae
@@@ -5102,9 -4761,9 +5102,9 @@@ AC_SUBST(LCC_VERSION_PATCH
  AC_SUBST(LCC_VERSION_EXTRA)
  AC_SUBST(LCC_VERSION_STRING)
  
- AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h)
+ AC_CONFIG_FILES(src/libcollectdclient/collectd/lcc_features.h)
  
 -AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/owniptc/Makefile src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile)
 +AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile)
  
  if test "x$with_librrd" = "xyes" \
        && test "x$librrd_threadsafe" != "xyes"
diff --cc src/Makefile.am
Simple merge
index 88a53023fb788a7c1439d2e41bf00e71b1a0b377,2d59ea77c25f239a9e4c8ea2a97971ac7d83c7b1..e31d95ca31f3e52ebd2923e0482b3e7f7973f294
  #include <string.h>
  #include <strings.h>
  #include <assert.h>
 -#include <math.h>
 +
 +#if NAN_STATIC_DEFAULT
 +# include <math.h>
 +/* #endif NAN_STATIC_DEFAULT*/
 +#elif NAN_STATIC_ISOC
 +# ifndef __USE_ISOC99
 +#  define DISABLE_ISOC99 1
 +#  define __USE_ISOC99 1
 +# endif /* !defined(__USE_ISOC99) */
 +# include <math.h>
 +# if DISABLE_ISOC99
 +#  undef DISABLE_ISOC99
 +#  undef __USE_ISOC99
 +# endif /* DISABLE_ISOC99 */
 +/* #endif NAN_STATIC_ISOC */
 +#elif NAN_ZERO_ZERO
 +# include <math.h>
 +# ifdef NAN
 +#  undef NAN
 +# endif
 +# define NAN (0.0 / 0.0)
 +# ifndef isnan
 +#  define isnan(f) ((f) != (f))
 +# endif /* !defined(isnan) */
 +# ifndef isfinite
 +#  define isfinite(f) (((f) - (f)) == 0.0)
 +# endif
 +# ifndef isinf
 +#  define isinf(f) (!isfinite(f) && !isnan(f))
 +# endif
 +#endif /* NAN_ZERO_ZERO */
  
- #include "libcollectdclient/client.h"
+ #include "libcollectdclient/collectd/client.h"
  
  #define RET_OKAY     0
  #define RET_WARNING  1
index 61b7fc55e2c24ff880730580abf2d48e0e0f571d,f16a70dd94285861bc5d8bac19debfc66a4f74f0..0b8d0c1e89ee1547f955c0795bf388d1568eb518
  
  #include <assert.h>
  #include <errno.h>
 -#include <math.h>
  
 -#include "libcollectdclient/collectd/client.h"
 +#if NAN_STATIC_DEFAULT
 +# include <math.h>
 +/* #endif NAN_STATIC_DEFAULT*/
 +#elif NAN_STATIC_ISOC
 +# ifndef __USE_ISOC99
 +#  define DISABLE_ISOC99 1
 +#  define __USE_ISOC99 1
 +# endif /* !defined(__USE_ISOC99) */
 +# include <math.h>
 +# if DISABLE_ISOC99
 +#  undef DISABLE_ISOC99
 +#  undef __USE_ISOC99
 +# endif /* DISABLE_ISOC99 */
 +/* #endif NAN_STATIC_ISOC */
 +#elif NAN_ZERO_ZERO
 +# include <math.h>
 +# ifdef NAN
 +#  undef NAN
 +# endif
 +# define NAN (0.0 / 0.0)
 +# ifndef isnan
 +#  define isnan(f) ((f) != (f))
 +# endif /* !defined(isnan) */
 +# ifndef isfinite
 +#  define isfinite(f) (((f) - (f)) == 0.0)
 +# endif
 +# ifndef isinf
 +#  define isinf(f) (!isfinite(f) && !isnan(f))
 +# endif
 +#endif /* NAN_ZERO_ZERO */
  
- #include "libcollectdclient/client.h"
++#include "libcollectdclient/collectd/client.h"
  
  #define DEFAULT_SOCK LOCALSTATEDIR"/run/"PACKAGE_NAME"-unixsock"
  
index 2adf6d48821d49590bde1186dd8c047c78eaa17a,abe3ed83aa469b4cf148504cd9f73403da3bad50..39875903256f686aefbb953b11a9e7e3ab72eebe
@@@ -1105,17 -1069,33 +1058,47 @@@ int lcc_string_to_identifier (lcc_conne
    return (0);
  } /* }}} int lcc_string_to_identifier */
  
-   qsort (idents, idents_num, sizeof (*idents), lcc_identifier_cmp);
+ int lcc_identifier_compare (const lcc_identifier_t *i0, /* {{{ */
+     const lcc_identifier_t *i1)
+ {
+   int status;
+   if ((i0 == NULL) && (i1 == NULL))
+     return (0);
+   else if (i0 == NULL)
+     return (-1);
+   else if (i1 == NULL)
+     return (1);
+ #define CMP_FIELD(f) do {         \
+   status = strcmp (i0->f, i1->f); \
+   if (status != 0)                \
+     return (status);              \
+ } while (0);
+     CMP_FIELD (host);
+     CMP_FIELD (plugin);
+     CMP_FIELD (plugin_instance);
+     CMP_FIELD (type);
+     CMP_FIELD (type_instance);
+ #undef CMP_FIELD
+     return (0);
+ } /* }}} int lcc_identifier_compare */
 +int lcc_sort_identifiers (lcc_connection_t *c, /* {{{ */
 +    lcc_identifier_t *idents, size_t idents_num)
 +{
 +  if (idents == NULL)
 +  {
 +    lcc_set_errno (c, EINVAL);
 +    return (-1);
 +  }
 +
++  qsort (idents, idents_num, sizeof (*idents),
++      (void *) lcc_identifier_compare);
 +  return (0);
 +} /* }}} int lcc_sort_identifiers */
 +
  /* vim: set sw=2 sts=2 et fdm=marker : */
index 36b1d4d28a3debe925c8074d06bf1285c2c7c9ea,1494c8d6cd66125885f725fe8d4d6bf98f7bade3..b2354ff4f153c20b4042e7b11e9455c2f452863a
@@@ -116,8 -116,11 +116,13 @@@ int lcc_identifier_to_string (lcc_conne
  int lcc_string_to_identifier (lcc_connection_t *c,
      lcc_identifier_t *ident, const char *string);
  
+ /* Compares the identifiers "i0" and "i1" and returns less than zero or greater
+  * than zero if "i0" is smaller than or greater than "i1", respectively. If
+  * "i0" and "i1" are identical, zero is returned. */
+ int lcc_identifier_compare (const lcc_identifier_t *i0,
+     const lcc_identifier_t *i1);
 +int lcc_sort_identifiers (lcc_connection_t *c,
 +    lcc_identifier_t *idents, size_t idents_num);
  
  LCC_END_DECLS