summaryrefslogtreecommitdiffhomepage
path: root/libs
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2009-03-12 13:06:19 +0000
committerSteven Barth <steven@midlink.org>2009-03-12 13:06:19 +0000
commit35f40376c36805c4a023015d4cf95f1fa8adcb04 (patch)
tree61b70a4fadf3dc6a4367df89d46f7c2751495da0 /libs
parente401b4a620ee968d4a191cb9c86ff0adde215a1e (diff)
nixio: FreeBSD compatibility #1
Diffstat (limited to 'libs')
-rw-r--r--libs/nixio/src/nixio.c2
-rw-r--r--libs/nixio/src/sockopt.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/libs/nixio/src/nixio.c b/libs/nixio/src/nixio.c
index 133837168..5e92f14dd 100644
--- a/libs/nixio/src/nixio.c
+++ b/libs/nixio/src/nixio.c
@@ -179,7 +179,7 @@ LUALIB_API int luaopen_nixio(lua_State *L) {
NIXIO_PUSH_CONSTANT(SIGQUIT);
NIXIO_PUSH_CONSTANT(SIGUSR1);
NIXIO_PUSH_CONSTANT(SIGUSR2);
- NIXIO_PUSH_CONSTANT(SIGPOLL);
+ NIXIO_PUSH_CONSTANT(SIGIO);
NIXIO_PUSH_CONSTANT(SIGURG);
lua_setfield(L, -2, "const");
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 <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
@@ -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 {