From: Marc Fournier Date: Tue, 21 Jan 2014 09:24:53 +0000 (+0100) Subject: amqp: fix symbol lookup error with librabbitmq >= 0.4.0 X-Git-Tag: collectd-5.4.1~1^2~1^2~2^2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=8d2726baaa71d65bc70e76adeb2aa33bcd4f1421;p=collectd.git amqp: fix symbol lookup error with librabbitmq >= 0.4.0 amqp_socket_close() which we were using isn't exported anymore. See https://github.com/alanxz/rabbitmq-c/commit/bdda7ab amqp_destroy_connection() implicitly closes the socket, so we don't need to bother about this if using librabbitmq >= 0.4.0 credits to @tokkee for figuring that out ! --- diff --git a/src/amqp.c b/src/amqp.c index 7de9d7f2..e5a2d79e 100644 --- a/src/amqp.c +++ b/src/amqp.c @@ -422,7 +422,7 @@ static int camqp_connect (camqp_config_t *conf) /* {{{ */ } #ifdef HAVE_AMQP_TCP_SOCKET -# define CLOSE_SOCKET() amqp_socket_close (socket) +# define CLOSE_SOCKET() // amqp_destroy_connection() closes the socket for us /* TODO: add support for SSL using amqp_ssl_socket_new * and related functions */ socket = amqp_tcp_socket_new (conf->connection); @@ -441,7 +441,6 @@ static int camqp_connect (camqp_config_t *conf) /* {{{ */ status *= -1; ERROR ("amqp plugin: amqp_socket_open failed: %s", sstrerror (status, errbuf, sizeof (errbuf))); - CLOSE_SOCKET (); amqp_destroy_connection (conf->connection); conf->connection = NULL; return (status);