From 35f40376c36805c4a023015d4cf95f1fa8adcb04 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Thu, 12 Mar 2009 13:06:19 +0000 Subject: nixio: FreeBSD compatibility #1 --- libs/nixio/src/sockopt.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libs/nixio/src/sockopt.c') diff --git a/libs/nixio/src/sockopt.c b/libs/nixio/src/sockopt.c index 6ec87539b..8884e9abc 100644 --- a/libs/nixio/src/sockopt.c +++ b/libs/nixio/src/sockopt.c @@ -17,6 +17,7 @@ */ #include "nixio.h" +#include #include #include #include @@ -148,7 +149,11 @@ static int nixio__getsetsockopt(lua_State *L, int set) { return luaL_error(L, "not a TCP socket"); } if (!strcmp(option, "cork")) { +#ifdef TCP_CORK return nixio__gso_int(L, sock->fd, IPPROTO_TCP, TCP_CORK, set); +#else + return nixio__pstatus(L, !(errno = ENOPROTOOPT)); +#endif } else if (!strcmp(option, "nodelay")) { return nixio__gso_int(L, sock->fd, IPPROTO_TCP, TCP_NODELAY, set); } else { -- cgit v1.2.3