X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fpinba.c;h=1a077065af093e817a21abf8977966d8a9d56edf;hb=b436c741540408a7f27d65c6faf5d3cc5e841610;hp=a6fd06fe2d56352a0a7e29cba18b394dd32559d2;hpb=66f9d645f883eee0aa408428eefdebdcc6dcfa7e;p=collectd.git diff --git a/src/pinba.c b/src/pinba.c index a6fd06fe..1a077065 100644 --- a/src/pinba.c +++ b/src/pinba.c @@ -35,6 +35,11 @@ #include "pinba.pb-c.h" +/* AIX doesn't have MSG_DONTWAIT */ +#ifndef MSG_DONTWAIT +# define MSG_DONTWAIT MSG_NONBLOCK +#endif + /* * Defines */ @@ -331,6 +336,7 @@ static int pb_add_socket (pinba_socket_t *s, /* {{{ */ char errbuf[1024]; ERROR ("pinba plugin: bind(2) failed: %s", sstrerror (errno, errbuf, sizeof (errbuf))); + close (fd); return (0); } @@ -617,7 +623,7 @@ static int plugin_config (oconfig_item_t *ci) /* {{{ */ if (strcasecmp ("Address", child->key) == 0) cf_util_get_string (child, &conf_node); else if (strcasecmp ("Port", child->key) == 0) - cf_util_get_string (child, &conf_service); + cf_util_get_service (child, &conf_service); else if (strcasecmp ("View", child->key) == 0) pinba_config_view (child); else @@ -645,7 +651,7 @@ static int plugin_init (void) /* {{{ */ if (collector_thread_running) return (0); - status = pthread_create (&collector_thread_id, + status = plugin_thread_create (&collector_thread_id, /* attrs = */ NULL, collector_thread, /* args = */ NULL);