Gitweb:        
http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=440c01afef56dbf659a5cf8fef24b14058e65ba3
Commit:        440c01afef56dbf659a5cf8fef24b14058e65ba3
Parent:        ce18a1ba007cd308c8de16ad56d215a8738d58ed
Author:        David Lutterkort <[email protected]>
AuthorDate:    Tue Sep 29 17:01:51 2009 -0700
Committer:     David Lutterkort <[email protected]>
CommitterDate: Wed Sep 30 12:10:56 2009 -0700

* src/hash.c (hash_alloc_insert): return 0/-1 for success/error

---
 src/hash.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/hash.c b/src/hash.c
index 892532f..42c320e 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -641,11 +641,11 @@ int hash_alloc_insert(hash_t *hash, const void *key, void 
*data)
     hnode_t *node = hash->allocnode(hash->context);
 
     if (node) {
-       hnode_init(node, data);
-       hash_insert(hash, node, key);
-       return 1;
+      hnode_init(node, data);
+      hash_insert(hash, node, key);
+      return 0;
     }
-    return 0;
+    return -1;
 }
 
 void hash_delete_free(hash_t *hash, hnode_t *node)
@@ -974,7 +974,7 @@ int main(void)
                     break;
                }
 
-               if (!hash_alloc_insert(h, key, val)) {
+               if (hash_alloc_insert(h, key, val) < 0) {
                    puts("hash_alloc_insert failed");
                    free((void *) key);
                    free(val);

_______________________________________________
augeas-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/augeas-devel

Reply via email to