diff options
author | Steven Barth <steven@midlink.org> | 2009-03-09 09:37:08 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2009-03-09 09:37:08 +0000 |
commit | 589e680970d44e5bd006844bdeb6ed355c8d345b (patch) | |
tree | 5920ecf03f66480e61bdb0c522c6f9bac4aca5c5 /libs/nixio/src | |
parent | 30b7bc7c623dbef9683b1ec1762a78bd0b6d684d (diff) |
Make nixio compile on OpenSolaris
Diffstat (limited to 'libs/nixio/src')
-rw-r--r-- | libs/nixio/src/process.c | 1 | ||||
-rw-r--r-- | libs/nixio/src/sockopt.c | 5 | ||||
-rw-r--r-- | libs/nixio/src/tls-socket.c | 10 |
3 files changed, 11 insertions, 5 deletions
diff --git a/libs/nixio/src/process.c b/libs/nixio/src/process.c index 19fa10ef2..e8f0cdc50 100644 --- a/libs/nixio/src/process.c +++ b/libs/nixio/src/process.c @@ -24,6 +24,7 @@ #include <string.h> #include <sys/wait.h> #include <sys/types.h> +#include <signal.h> static int nixio_fork(lua_State *L) { pid_t pid = fork(); diff --git a/libs/nixio/src/sockopt.c b/libs/nixio/src/sockopt.c index b80e2e353..6ec87539b 100644 --- a/libs/nixio/src/sockopt.c +++ b/libs/nixio/src/sockopt.c @@ -23,6 +23,7 @@ #include <sys/time.h> #include <string.h> #include <fcntl.h> +#include <errno.h> #include "nixio.h" @@ -124,7 +125,11 @@ static int nixio__getsetsockopt(lua_State *L, int set) { } else if (!strcmp(option, "sndbuf")) { return nixio__gso_int(L, sock->fd, SOL_SOCKET, SO_SNDBUF, set); } else if (!strcmp(option, "priority")) { +#ifdef SO_PRIORITY return nixio__gso_int(L, sock->fd, SOL_SOCKET, SO_PRIORITY, set); +#else + return nixio__pstatus(L, !(errno = ENOPROTOOPT)); +#endif } else if (!strcmp(option, "broadcast")) { return nixio__gso_int(L, sock->fd, SOL_SOCKET, SO_BROADCAST, set); } else if (!strcmp(option, "linger")) { diff --git a/libs/nixio/src/tls-socket.c b/libs/nixio/src/tls-socket.c index 3b0744f04..693a2a551 100644 --- a/libs/nixio/src/tls-socket.c +++ b/libs/nixio/src/tls-socket.c @@ -82,11 +82,11 @@ static int nixio_tls_sock_recv(lua_State *L) { t->pbufsiz -= req; return 1; } else { - char *axbuf; - int axread; + uint8_t *axbuf; + size_t axread; /* while handshake pending */ - while ((axread = ssl_read(sock, (uint8_t**)&axbuf)) == SSL_OK); + while ((axread = ssl_read(sock, &axbuf)) == SSL_OK); if (t->pbufsiz) { lua_pushlstring(L, t->pbufpos, t->pbufsiz); @@ -111,7 +111,7 @@ static int nixio_tls_sock_recv(lua_State *L) { int stillwant = req - t->pbufsiz; if (stillwant < axread) { /* we got more data than we need */ - lua_pushlstring(L, axbuf, stillwant); + lua_pushlstring(L, (char *)axbuf, stillwant); if(t->pbufsiz) { lua_concat(L, 2); } @@ -130,7 +130,7 @@ static int nixio_tls_sock_recv(lua_State *L) { t->pbufpos = t->pbuffer; memcpy(t->pbufpos, axbuf + stillwant, t->pbufsiz); } else { - lua_pushlstring(L, axbuf, axread); + lua_pushlstring(L, (char *)axbuf, axread); if(t->pbufsiz) { lua_concat(L, 2); } |