# HG changeset patch # User Kim Alvefur # Date 1464204909 -7200 # Node ID df1be36f87b1218b9947973eb72bc74d5e46a94c # Parent 6bf4c227c8f3e6953adc899f2e7fb7f466463d67# Parent 5424e24cdcb174b8cf0a9a68de1793d0b5f1e303 Merge 0.10->trunk diff -r 6bf4c227c8f3 -r df1be36f87b1 util-src/crand.c --- a/util-src/crand.c Sun May 22 20:07:20 2016 +0100 +++ b/util-src/crand.c Wed May 25 21:35:09 2016 +0200 @@ -106,7 +106,7 @@ #endif - lua_pushlstring(L, buf, ret); + lua_pushlstring(L, (const char *)buf, ret); #ifndef BUFLEN free(buf); #endif diff -r 6bf4c227c8f3 -r df1be36f87b1 util-src/pposix.c --- a/util-src/pposix.c Sun May 22 20:07:20 2016 +0100 +++ b/util-src/pposix.c Wed May 25 21:35:09 2016 +0200 @@ -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) {