X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fcollectdctl.c;h=2329285371281e849e5bf82994111912201d2036;hp=e1091cc6467a5669d4e9aee2e2d5dfa30d9ff730;hb=633c3966f770e4d46651a2fe219a18d8a9907a9f;hpb=626041ce6fa004ce49c183f35147f762a63cf302 diff --git a/src/collectdctl.c b/src/collectdctl.c index e1091cc6..23292853 100644 --- a/src/collectdctl.c +++ b/src/collectdctl.c @@ -25,18 +25,6 @@ # include "config.h" #endif -#ifndef _ISOC99_SOURCE -# define _ISOC99_SOURCE -#endif - -#ifndef _POSIX_C_SOURCE -# define _POSIX_C_SOURCE 200112L -#endif - -#ifndef _XOPEN_SOURCE -# define _XOPEN_SOURCE 600 -#endif - #include #include #include @@ -45,10 +33,39 @@ #include #include -#include - -#include "libcollectdclient/client.h" +#if NAN_STATIC_DEFAULT +# include +/* #endif NAN_STATIC_DEFAULT*/ +#elif NAN_STATIC_ISOC +# ifndef __USE_ISOC99 +# define DISABLE_ISOC99 1 +# define __USE_ISOC99 1 +# endif /* !defined(__USE_ISOC99) */ +# include +# if DISABLE_ISOC99 +# undef DISABLE_ISOC99 +# undef __USE_ISOC99 +# endif /* DISABLE_ISOC99 */ +/* #endif NAN_STATIC_ISOC */ +#elif NAN_ZERO_ZERO +# include +# 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/collectd/client.h" #define DEFAULT_SOCK LOCALSTATEDIR"/run/"PACKAGE_NAME"-unixsock" @@ -82,7 +99,7 @@ static void exit_usage (const char *name, int status) { "No error is returned if the specified identifier does not exist.\n" "\n"PACKAGE" "VERSION", http://collectd.org/\n" - "by Florian octo Forster \n" + "by Florian octo Forster \n" "for contributions see `AUTHORS'\n" , name); exit (status); @@ -468,7 +485,7 @@ static int putval (lcc_connection_t *c, int argc, char **argv) while (value != 0) { char *dot, *endptr; - tmp = strchr (argv[i], (int)':'); + tmp = strchr (value, (int)':'); if (tmp != NULL) { *tmp = '\0';