diff --git a/src/modbus-tcp.c b/src/modbus-tcp.c index aa4e3c6..8654bee 100644 --- a/src/modbus-tcp.c +++ b/src/modbus-tcp.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #if defined(_WIN32) @@ -32,7 +33,7 @@ # include # include -#if defined(OpenBSD) || (defined(__FreeBSD__) && __FreeBSD__ < 5) +#if defined(__OpenBSD__) || (defined(__FreeBSD__) && __FreeBSD__ < 5) # define OS_BSD # include #endif @@ -434,7 +435,7 @@ modbus_t* modbus_new_tcp(const char *ip, int port) if (sigaction(SIGPIPE, &sa, NULL) < 0) { /* The debug flag can't be set here... */ fprintf(stderr, "Coud not install SIGPIPE handler.\n"); - return -1; + return NULL; } #endif