X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Flibcollectdclient%2Fclient.c;h=df6fd960006fb82a80e4ab625a82c3ef2e955bcd;hb=063e81d76677a3b52c5d8a1fbfbdf2bf87a75cee;hp=d47032455325e6e36210d62cc3b6236dd72fd02f;hpb=4380983e0a45e2d1c1207dbea95863d1dcc844c6;p=collectd.git diff --git a/src/libcollectdclient/client.c b/src/libcollectdclient/client.c index d4703245..df6fd960 100644 --- a/src/libcollectdclient/client.c +++ b/src/libcollectdclient/client.c @@ -24,6 +24,11 @@ * Florian octo Forster **/ +#ifdef WIN32 +#include "gnulib_config.h" +#include +#endif + #include "config.h" #if !defined(__GNUC__) || !__GNUC__ @@ -40,11 +45,14 @@ #include #include #include -#include #include -#include #include +#ifndef WIN32 +#include +#include +#endif + #include "collectd/client.h" /* NI_MAXHOST has been obsoleted by RFC 3493 which is a reason for SunOS 5.11 @@ -62,6 +70,10 @@ #endif #endif +#ifdef WIN32 +#define AI_ADDRCONFIG 0 +#endif + /* Secure/static macros. They work like `strcpy' and `strcat', but assure null * termination. They work for static buffers only, because they use `sizeof'. * The `SSTRCATF' combines the functionality of `snprintf' and `strcat' which @@ -367,6 +379,10 @@ static int lcc_sendreceive(lcc_connection_t *c, /* {{{ */ static int lcc_open_unixsocket(lcc_connection_t *c, const char *path) /* {{{ */ { +#ifdef WIN32 + lcc_set_errno(c, ENOTSUP); + return -1; +#else struct sockaddr_un sa = {0}; int fd; int status; @@ -401,6 +417,7 @@ static int lcc_open_unixsocket(lcc_connection_t *c, const char *path) /* {{{ */ } return 0; +#endif /* WIN32 */ } /* }}} int lcc_open_unixsocket */ static int lcc_open_netsocket(lcc_connection_t *c, /* {{{ */