X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fmemcached.c;h=8490bf661b358d793a0701c779ad2758587b2df7;hb=c4714768f57d881a2b0408e5a2d4b09603c1389f;hp=06cf2001b6287adb49b8843fc69994f962ae1c65;hpb=658e44d47088aaea3c59fb248336a74fdefe4245;p=collectd.git diff --git a/src/memcached.c b/src/memcached.c index 06cf2001..8490bf66 100644 --- a/src/memcached.c +++ b/src/memcached.c @@ -38,6 +38,11 @@ # include # include +/* Hack to work around the missing define in AIX */ +#ifndef MSG_DONTWAIT +# define MSG_DONTWAIT MSG_NONBLOCK +#endif + #define MEMCACHED_DEF_HOST "127.0.0.1" #define MEMCACHED_DEF_PORT "11211" @@ -115,7 +120,7 @@ static int memcached_query_daemon (char *buffer, int buffer_size) /* {{{ */ port = MEMCACHED_DEF_PORT; } - if ((ai_return = getaddrinfo (host, port, NULL, &ai_list)) != 0) { + if ((ai_return = getaddrinfo (host, port, &ai_hints, &ai_list)) != 0) { char errbuf[1024]; ERROR ("memcached: getaddrinfo (%s, %s): %s", host, port, @@ -297,7 +302,6 @@ static void submit_counter2 (const char *type, const char *type_inst, vl.values = values; vl.values_len = 2; - vl.time = time (NULL); sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "memcached", sizeof (vl.plugin)); sstrncpy (vl.type, type, sizeof (vl.type)); @@ -318,7 +322,6 @@ static void submit_gauge (const char *type, const char *type_inst, vl.values = values; vl.values_len = 1; - vl.time = time (NULL); sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "memcached", sizeof (vl.plugin)); sstrncpy (vl.type, type, sizeof (vl.type)); @@ -340,7 +343,6 @@ static void submit_gauge2 (const char *type, const char *type_inst, vl.values = values; vl.values_len = 2; - vl.time = time (NULL); sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "memcached", sizeof (vl.plugin)); sstrncpy (vl.type, type, sizeof (vl.type));