setup.c | 6 ++++++
1 file changed, 6 insertions(+)
New commits:
commit c26279efbbb95a76a9d48afecdadd712c8f91bff
Author: Jim Meyering <meyering(a)redhat.com>
Date: Thu Mar 3 16:34:21 2011 +0100
give better diagnostic upon OOM
* setup.c (hash_insert_new): Call xalloc_die upon OOM, so we
print a diagnostic. Better than getting a failed assertion.
* setup.c (add_provider): Add a comment.
diff --git a/setup.c b/setup.c
index fc83c0c..3f35355 100644
--- a/setup.c
+++ b/setup.c
@@ -89,6 +89,8 @@ static void
hash_insert_new (Hash_table *ht, const void *ent)
{
void *e = hash_insert (ht, ent);
+ if (e == NULL)
+ xalloc_die ();
assert (e == ent);
}
@@ -363,6 +365,10 @@ convert_provider (int i, provider_t *out)
return 1;
}
+/* Add provider H (defined by its key/value pairs) to PROV_HASH.
+ The new entry in PROV_HASH uses the "name" value from H, and all other
+ attributes are key/value pairs in a newly-allocated hash that makes
+ up the "value". */
int
add_provider (Hash_table *h)
{
Show replies by date