From 478e9b9327fe09be13db51d64c8a175a0902789f Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 25 May 2016 16:54:43 +0200 Subject: util.crand: Silence compiler warning --- util-src/crand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util-src') diff --git a/util-src/crand.c b/util-src/crand.c index 735135fb..fbdec8f8 100644 --- a/util-src/crand.c +++ b/util-src/crand.c @@ -106,7 +106,7 @@ int Lrandom(lua_State *L) { #endif - lua_pushlstring(L, buf, ret); + lua_pushlstring(L, (const char *)buf, ret); #ifndef BUFLEN free(buf); #endif -- cgit v1.2.3 From 01a15bfbe296ed254b1daae646f07640e389d70d Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 25 May 2016 21:34:34 +0200 Subject: util.pposix: Ask for shared file descriptor table using rfork() on *BSD (fixes #412) --- util-src/pposix.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'util-src') diff --git a/util-src/pposix.c b/util-src/pposix.c index 1b69852d..b48465d3 100644 --- a/util-src/pposix.c +++ b/util-src/pposix.c @@ -49,6 +49,19 @@ #define WITH_MALLINFO #endif +#if defined(RFPROC) && defined(EV_SET) +/* + * On *BSD, calling fork() is equivalent to rfork(RFPROC | RFFDG). + * + * RFFDG being set means that the file descriptor table is copied, + * otherwise it's shared. We want the later, otherwise libevent gets + * messed up. + * + * See issue #412 + */ +#define fork() rfork(RFPROC) +#endif + /* Daemonization support */ static int lc_daemonize(lua_State* L) { -- cgit v1.2.3