X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcollectdctl.c;h=8c884796403edfa9c6d69aec38421d6dbad359e7;hb=6a4e409854a5322bed28347237a7614c59925e2a;hp=e60781a91d63aa9253eb134ec12e4c3879afb8b6;hpb=e6798095bb2f063dd97619399575fef3e0fe501e;p=collectd.git diff --git a/src/collectdctl.c b/src/collectdctl.c index e60781a9..8c884796 100644 --- a/src/collectdctl.c +++ b/src/collectdctl.c @@ -67,6 +67,14 @@ #include "libcollectdclient/collectd/client.h" +#ifndef PREFIX +# define PREFIX "/opt/" PACKAGE_NAME +#endif + +#ifndef LOCALSTATEDIR +# define LOCALSTATEDIR PREFIX "/var" +#endif + #define DEFAULT_SOCK LOCALSTATEDIR"/run/"PACKAGE_NAME"-unixsock" extern char *optarg; @@ -312,7 +320,7 @@ static int flush (lcc_connection_t *c, int argc, char **argv) plugins[0] = NULL; } - for (int i = 0; i < plugins_num; ++i) { + for (size_t i = 0; i < plugins_num; ++i) { if (identifiers_num == 0) { status = lcc_flush (c, plugins[i], NULL, timeout); if (status != 0) @@ -320,7 +328,7 @@ static int flush (lcc_connection_t *c, int argc, char **argv) (plugins[i] == NULL) ? "(all)" : plugins[i], lcc_strerror (c)); } else { - for (int j = 0; j < identifiers_num; ++j) { + for (size_t j = 0; j < identifiers_num; ++j) { status = lcc_flush (c, plugins[i], identifiers + j, timeout); if (status != 0) { char id[1024];