Even the post glib 2.40 version will only return false if the value is
already present in the hashtable but will not fail to add it. The old
value will be handled according to the configuration of the hashtable
which should not be an error.
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Change-Id: I5512c921ce220bf8a956c61f594d6a27e6ceb41e
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1247
Tested-by: jenkins
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
}
/* 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();
fd_internal = g_hash_table_lookup(fdc->cache, &fk);
if (!fd_internal) {
- gboolean ret;
struct file_key *file_key;
int fd = open(path, O_RDONLY);
fd_internal->key = file_key;
/* Insert the newly created fd handle. */
- ret = g_hash_table_insert(fdc->cache, fd_internal->key,
- fd_internal);
- BT_ASSERT(ret);
+ g_hash_table_insert(fdc->cache, fd_internal->key, fd_internal);
}
BT_ASSERT(fd_internal->ref_count >= 0);