X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fmodbus.c;h=589ce90fd2e2b85d86714f11f0ceb87ab34b573b;hb=1d888f3f3a131f8eb2d9e0884665b6951ecee550;hp=a7d1b582c76fb27a3007aaad27a83abc60bd0616;hpb=5cd5988ec752f441254fc887117c3d5aa8f8d094;p=collectd.git diff --git a/src/modbus.c b/src/modbus.c index a7d1b582..589ce90f 100644 --- a/src/modbus.c +++ b/src/modbus.c @@ -23,11 +23,12 @@ #include "collectd.h" #include "common.h" +#include "configfile.h" #include "plugin.h" -#include - #include +#include +#include #ifndef LIBMODBUS_VERSION_CHECK /* Assume version 2.0.3 */ @@ -472,10 +473,9 @@ static int mb_read_data (mb_host_t *host, mb_slave_t *slave, /* {{{ */ { /* getpeername() is used only to determine if the socket is connected, not * because we're really interested in the peer's IP address. */ - status = getpeername (modbus_get_socket (host->connection), - (struct sockaddr *) &(struct sockaddr_storage) { 0 }, - &(socklen_t) { sizeof (struct sockaddr_storage) }); - if (status != 0) + if (getpeername (modbus_get_socket (host->connection), + (void *) &(struct sockaddr_storage) {0}, + &(socklen_t) {sizeof(struct sockaddr_storage)}) != 0) status = errno; }