enable malloc_usable_size on haiku and dragonflybsd. (#12237)

This commit is contained in:
David CARLIER 2023-05-28 06:44:28 +01:00 committed by GitHub
parent 1a188e4ed6
commit da46e926ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -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 */

View File

@ -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 <malloc_np.h>
#else
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <malloc.h>
#endif