From 72ee68ee20283414a7fb459cb87825c060ddc6b9 Mon Sep 17 00:00:00 2001 From: Stéphane Raimbault Date: Mon, 7 Apr 2008 18:18:34 +0200 Subject: [PATCH] Reduce the difference with the MacOS X verion. --- modbus/modbus.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/modbus/modbus.c b/modbus/modbus.c index 13fc3b7..1f7c881 100644 --- a/modbus/modbus.c +++ b/modbus/modbus.c @@ -51,11 +51,6 @@ #include "modbus.h" -#ifdef __APPLE_CC__ - #include - #define SOL_TCP getprotobyname("TCP")->p_proto -#endif - #define UNKNOWN_ERROR_MSG "Not defined in modbus specification" static const uint8_t NB_TAB_ERROR_MSG = 12; @@ -1476,7 +1471,7 @@ static int modbus_connect_tcp(modbus_param_t *mb_param) /* Set the TCP no delay flag */ /* SOL_TCP = IPPROTO_TCP */ option = 1; - ret = setsockopt(mb_param->fd, SOL_TCP, TCP_NODELAY, + ret = setsockopt(mb_param->fd, IPPROTO_TCP, TCP_NODELAY, (const void *)&option, sizeof(int)); if (ret < 0) { perror("setsockopt"); @@ -1486,7 +1481,7 @@ static int modbus_connect_tcp(modbus_param_t *mb_param) /* Set the IP low delay option */ option = IPTOS_LOWDELAY; - ret = setsockopt(mb_param->fd, SOL_TCP, IP_TOS, + ret = setsockopt(mb_param->fd, IPPROTO_TCP, IP_TOS, (const void *)&option, sizeof(int)); if (ret < 0) { perror("setsockopt"); -- libgit2 0.21.4