From 018bd41edf9b5755099f996b3f8ddc43fde133c0 Mon Sep 17 00:00:00 2001 From: Stéphane Raimbault Date: Thu, 13 Jan 2011 22:08:25 +0100 Subject: [PATCH] Fix compilation on OpenBSD --- src/modbus-tcp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 -- libgit2 0.21.4