Fix some errno abuse.
[oweals/opkg-lede.git] / libopkg / hash_table.c
index 181d319a6217512d8e64c3f5a43a02cb5feb6256..2d42d911f741f4d07cb30e63024d5fe500adcaf2 100644 (file)
@@ -15,7 +15,6 @@
    General Public License for more details.
 */
 
-#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -43,13 +42,13 @@ hash_index(hash_table_t *hash, const char *key)
 /*
  * this is an open table keyed by strings
  */
-int
+void
 hash_table_init(const char *name, hash_table_t *hash, int len)
 {
        if (hash->entries != NULL) {
                fprintf(stderr, "ERROR: %s called on a non empty hash table\n",
                                __FUNCTION__);
-               return -1;
+               return;
        }
 
        memset(hash, 0, sizeof(hash_table_t));
@@ -57,8 +56,6 @@ hash_table_init(const char *name, hash_table_t *hash, int len)
        hash->name = name;
        hash->n_buckets = len;
        hash->entries = xcalloc(hash->n_buckets, sizeof(hash_entry_t));
-
-       return 0;
 }
 
 void