X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fpinba.c;h=e94ad8f61b667b0728085bff1c5a7129f9dcd802;hb=6258e772d808f4e76ea8e23d9e2750cfc7e6c60d;hp=26aa539b413a2fefcddeec0734e18c5f65dc0f68;hpb=45aa67ef031ed2b8083f92efa2cbb76e0da8c02e;p=collectd.git diff --git a/src/pinba.c b/src/pinba.c index 26aa539b..e94ad8f6 100644 --- a/src/pinba.c +++ b/src/pinba.c @@ -20,7 +20,7 @@ * Authors: * Antony Dovgal * Phoenix Kayo - * Florian Forster + * Florian Forster **/ #include "collectd.h" @@ -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); } @@ -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);