r4830 - trunk/src/target/opkg/libopkg

tick at docs.openmoko.org tick at docs.openmoko.org
Thu Nov 27 18:39:40 CET 2008


Author: tick
Date: 2008-11-27 18:39:39 +0100 (Thu, 27 Nov 2008)
New Revision: 4830

Modified:
   trunk/src/target/opkg/libopkg/hash_table.c
Log:
opkg: making hash_table_insert works as real hash_table.
solving the update_file_ownership misbehaviour issue, and redundent installed files issue.


Modified: trunk/src/target/opkg/libopkg/hash_table.c
===================================================================
--- trunk/src/target/opkg/libopkg/hash_table.c	2008-11-27 17:39:24 UTC (rev 4829)
+++ trunk/src/target/opkg/libopkg/hash_table.c	2008-11-27 17:39:39 UTC (rev 4830)
@@ -139,8 +139,13 @@
 		* before we can hook up the value
 		*/
                if (0) opkg_message(NULL, OPKG_DEBUG2, "Function: %s. Value already in hash by collision for '%s' \n", __FUNCTION__, key);
-	       while (hash_entry->next)
+	       while (hash_entry->next) {
 		    hash_entry = hash_entry->next;
+                    if (strcmp(hash_entry->key, key) == 0) {
+                        hash_entry->data = value;
+                        return 0;
+                    }
+               }
 	       hash_entry->next = (hash_entry_t *)malloc(sizeof(hash_entry_t));
 	       if (!hash_entry->next) {
 		    return -ENOMEM;




More information about the commitlog mailing list