From be4b215d9e56a9264b818d6742cc93164963ff46 Mon Sep 17 00:00:00 2001 From: Stéphane Raimbault Date: Sat, 19 May 2012 23:39:05 +0200 Subject: [PATCH] Fix TCP PI init under Windows --- src/modbus-tcp.c | 6 ++++++ 1 file changed, 6 insertions(+), 0 deletions(-) diff --git a/src/modbus-tcp.c b/src/modbus-tcp.c index 2b737c4..75b9665 100644 --- a/src/modbus-tcp.c +++ b/src/modbus-tcp.c @@ -328,6 +328,12 @@ static int _modbus_tcp_pi_connect(modbus_t *ctx) struct addrinfo ai_hints; modbus_tcp_pi_t *ctx_tcp_pi = ctx->backend_data; +#ifdef OS_WIN32 + if (_modbus_tcp_init_win32() == -1) { + return -1; + } +#endif + memset(&ai_hints, 0, sizeof(ai_hints)); #ifdef AI_ADDRCONFIG ai_hints.ai_flags |= AI_ADDRCONFIG; -- libgit2 0.21.4