diff --git a/src/config.c b/src/config.c index 36c2e42b7..e506060a9 100644 --- a/src/config.c +++ b/src/config.c @@ -1685,7 +1685,7 @@ int rewriteConfigOverwriteFile(char *configfile, sds content) { return retval; } -#ifdef _GNU_SOURCE +#if defined(_GNU_SOURCE) && !defined(__HAIKU__) fd = mkostemp(tmp_conffile, O_CLOEXEC); #else /* There's a theoretical chance here to leak the FD if a module thread forks & execv in the middle */ diff --git a/src/zmalloc.h b/src/zmalloc.h index 1ff66a635..491013a85 100644 --- a/src/zmalloc.h +++ b/src/zmalloc.h @@ -74,12 +74,16 @@ #if !defined(NO_MALLOC_USABLE_SIZE) && \ (defined(__GLIBC__) || defined(__FreeBSD__) || \ + defined(__DragonFly__) || defined(__HAIKU__) || \ defined(USE_MALLOC_USABLE_SIZE)) /* Includes for malloc_usable_size() */ #ifdef __FreeBSD__ #include #else +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif #include #endif