Commit 10f92e2f664eef070b4966ea9a58fbd1fab2c1d7
1 parent
1c11970f
Move setting of option inside the relevant conditional group
Showing
1 changed file
with
1 additions
and
1 deletions
src/modbus-tcp.c
| @@ -225,7 +225,6 @@ static int _modbus_tcp_set_ipv4_options(int s) | @@ -225,7 +225,6 @@ static int _modbus_tcp_set_ipv4_options(int s) | ||
| 225 | /* If the OS does not offer SOCK_NONBLOCK, fall back to setting FIONBIO to | 225 | /* If the OS does not offer SOCK_NONBLOCK, fall back to setting FIONBIO to |
| 226 | * make sockets non-blocking */ | 226 | * make sockets non-blocking */ |
| 227 | /* Do not care about the return value, this is optional */ | 227 | /* Do not care about the return value, this is optional */ |
| 228 | - option = 1; | ||
| 229 | #if !defined(SOCK_NONBLOCK) && defined(FIONBIO) | 228 | #if !defined(SOCK_NONBLOCK) && defined(FIONBIO) |
| 230 | #ifdef OS_WIN32 | 229 | #ifdef OS_WIN32 |
| 231 | { | 230 | { |
| @@ -234,6 +233,7 @@ static int _modbus_tcp_set_ipv4_options(int s) | @@ -234,6 +233,7 @@ static int _modbus_tcp_set_ipv4_options(int s) | ||
| 234 | ioctlsocket(s, FIONBIO, &loption); | 233 | ioctlsocket(s, FIONBIO, &loption); |
| 235 | } | 234 | } |
| 236 | #else | 235 | #else |
| 236 | + option = 1; | ||
| 237 | ioctl(s, FIONBIO, &option); | 237 | ioctl(s, FIONBIO, &option); |
| 238 | #endif | 238 | #endif |
| 239 | #endif | 239 | #endif |