#include "collectd.h"
#include "common.h"
+#include "configfile.h"
#include "plugin.h"
-#include <netdb.h>
-
#include <modbus.h>
+#include <netdb.h>
+#include <sys/socket.h>
#ifndef LIBMODBUS_VERSION_CHECK
/* Assume version 2.0.3 */
{
/* 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;
}