X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcollectdctl.c;h=febc99833aaa917f084e4d606e34a84c70b90fb4;hb=939f4098d43c2934a9a97e076d64a7504613b872;hp=61b7fc55e2c24ff880730580abf2d48e0e0f571d;hpb=59dded4cc1a2077ad11c6e9b507e15ad19e0e38c;p=collectd.git diff --git a/src/collectdctl.c b/src/collectdctl.c index 61b7fc55..febc9983 100644 --- a/src/collectdctl.c +++ b/src/collectdctl.c @@ -65,7 +65,7 @@ # endif #endif /* NAN_ZERO_ZERO */ -#include "libcollectdclient/client.h" +#include "libcollectdclient/collectd/client.h" #define DEFAULT_SOCK LOCALSTATEDIR"/run/"PACKAGE_NAME"-unixsock" @@ -98,8 +98,8 @@ static void exit_usage (const char *name, int status) { "Hostname defaults to the local hostname if omitted (e.g., uptime/uptime).\n" "No error is returned if the specified identifier does not exist.\n" - "\n"PACKAGE" "VERSION", http://collectd.org/\n" - "by Florian octo Forster \n" + "\n"PACKAGE_NAME" "PACKAGE_VERSION", http://collectd.org/\n" + "by Florian octo Forster \n" "for contributions see `AUTHORS'\n" , name); exit (status); @@ -120,7 +120,7 @@ static int count_chars (const char *str, char chr) { return count; } /* count_chars */ -static int array_grow (void **array, int *array_len, size_t elem_size) +static int array_grow (void **array, size_t *array_len, size_t elem_size) { void *tmp; @@ -229,10 +229,10 @@ static int flush (lcc_connection_t *c, int argc, char **argv) int timeout = -1; lcc_identifier_t *identifiers = NULL; - int identifiers_num = 0; + size_t identifiers_num = 0; char **plugins = NULL; - int plugins_num = 0; + size_t plugins_num = 0; int status; int i; @@ -507,7 +507,7 @@ static int putval (lcc_connection_t *c, int argc, char **argv) values_types[values_len] = LCC_TYPE_GAUGE; } else { /* integer */ - values[values_len].counter = strtol (value, &endptr, 0); + values[values_len].counter = (counter_t) strtoull (value, &endptr, 0); values_types[values_len] = LCC_TYPE_COUNTER; } ++values_len; @@ -551,14 +551,14 @@ int main (int argc, char **argv) { int status; while (42) { - int c; + int opt; - c = getopt (argc, argv, "s:h"); + opt = getopt (argc, argv, "s:h"); - if (c == -1) + if (opt == -1) break; - switch (c) { + switch (opt) { case 's': snprintf (address, sizeof (address), "unix:%s", optarg); address[sizeof (address) - 1] = '\0';