basic/hashmap: make _ensure_allocated return 1 on actual allocations

Also, make test_hashmap_ensure_allocated() actually test
hashmap_ensure_allocated().
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2020-05-27 16:48:04 +02:00
parent 49d5aae503
commit 9ff7c5b031
2 changed files with 14 additions and 13 deletions
+1 -1
View File
@@ -835,7 +835,7 @@ static int hashmap_base_ensure_allocated(HashmapBase **h, const struct hash_ops
return -ENOMEM;
*h = q;
return 0;
return 1;
}
int internal_hashmap_ensure_allocated(Hashmap **h, const struct hash_ops *hash_ops HASHMAP_DEBUG_PARAMS) {