From 10f92e2f664eef070b4966ea9a58fbd1fab2c1d7 Mon Sep 17 00:00:00 2001 From: Stéphane Raimbault Date: Wed, 11 May 2016 16:41:42 +0200 Subject: [PATCH] Move setting of option inside the relevant conditional group --- src/modbus-tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modbus-tcp.c b/src/modbus-tcp.c index b6d42b2..15a8f00 100644 --- a/src/modbus-tcp.c +++ b/src/modbus-tcp.c @@ -225,7 +225,6 @@ static int _modbus_tcp_set_ipv4_options(int s) /* If the OS does not offer SOCK_NONBLOCK, fall back to setting FIONBIO to * make sockets non-blocking */ /* Do not care about the return value, this is optional */ - option = 1; #if !defined(SOCK_NONBLOCK) && defined(FIONBIO) #ifdef OS_WIN32 { @@ -234,6 +233,7 @@ static int _modbus_tcp_set_ipv4_options(int s) ioctlsocket(s, FIONBIO, &loption); } #else + option = 1; ioctl(s, FIONBIO, &option); #endif #endif -- libgit2 0.21.4