X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Flibcollectdclient%2Fclient.c;h=df6fd960006fb82a80e4ab625a82c3ef2e955bcd;hb=063e81d76677a3b52c5d8a1fbfbdf2bf87a75cee;hp=3ae2e714b7b643a5c8632a883f81d91fa8790352;hpb=7f38ca96e3a54a4b02475f857c7d79c6a1257ada;p=collectd.git diff --git a/src/libcollectdclient/client.c b/src/libcollectdclient/client.c index 3ae2e714..df6fd960 100644 --- a/src/libcollectdclient/client.c +++ b/src/libcollectdclient/client.c @@ -24,10 +24,13 @@ * Florian octo Forster **/ -#if HAVE_CONFIG_H -#include "config.h" +#ifdef WIN32 +#include "gnulib_config.h" +#include #endif +#include "config.h" + #if !defined(__GNUC__) || !__GNUC__ #define __attribute__(x) /**/ #endif @@ -42,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 @@ -64,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 @@ -369,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; @@ -403,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, /* {{{ */