X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=compat%2Fcompat_mman.c;h=bef80d481ecb952ca794b991e1f15669588bf215;hb=68b66a256a54d32992dfefeaad11eea88b7df234;hp=1c95d8eff66d59d1a2f3b6758e8f4c0994bcdbf5;hpb=04394229f0daeeb36a09ea64f3208fe051fd9ca0;p=babeltrace.git diff --git a/compat/compat_mman.c b/compat/compat_mman.c index 1c95d8ef..bef80d48 100644 --- a/compat/compat_mman.c +++ b/compat/compat_mman.c @@ -29,6 +29,15 @@ #define BT_LOG_TAG "COMPAT-MMAN" #include "logging.h" +#ifdef __APPLE__ +/* + * On macOS, we need a dummy symbol so that the linker won't + * complain of an empty table of contents. + */ +BT_HIDDEN +int bt_mman_dummy_symbol; +#endif /* __APPLE__ */ + #ifdef __MINGW32__ #include @@ -36,7 +45,7 @@ #include #include #include -#include +#include struct mmap_mapping { /* The duplicated handle. */ @@ -235,10 +244,7 @@ void *bt_mmap(void *addr, size_t length, int prot, int flags, int fd, } /* Add the new mapping to the hashtable. */ - if (!g_hash_table_insert(mmap_mappings, mapping_addr, mapping)) { - BT_LOGF_STR("Failed to insert mapping in the hashtable."); - abort(); - } + g_hash_table_insert(mmap_mappings, mapping_addr, mapping); mmap_unlock();