From: Kim Alvefur Date: Wed, 25 May 2016 19:35:09 +0000 (+0200) Subject: Merge 0.10->trunk X-Git-Url: https://git.enpas.org/?a=commitdiff_plain;h=8df2517bf2e7930e32ebf79a11b29206cb30782c;hp=f6f011dfbc3d179c77c0431ffacfaaf091f18053;p=prosody.git Merge 0.10->trunk --- 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 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) {