return -ENOMEM;
}
snprintf(dinfo->name, len, "%s", parent_dir);
- g_hash_table_insert(entry->dir_hash, dinfo->name, dinfo);
+
fileinfo_to_stat(NULL, &dinfo->stat, S_IFDIR);
+ g_hash_table_insert(entry->dir_hash, dinfo->name, dinfo);
}
finfo = (struct tzip_file_info *)g_hash_table_lookup(
strncpy(finfo->name, filename, len);
fileinfo_to_stat(file_info, &finfo->stat, mode);
-
g_hash_table_insert(dinfo->file_hash, finfo->name, finfo);
}
ret = -ENOMEM;
goto out;
}
-
strncpy(entry->zip_path, zip_path, len);
g_hash_table_insert(hashmap, entry->path, entry);
g_hash_table_iter_init(&f_iter, dinfo->file_hash);
while (g_hash_table_iter_next(&f_iter, &fkey, &fval)) {
finfo = (struct tzip_file_info *)fval;
- g_hash_table_remove(dinfo->file_hash, fkey);
+ g_hash_table_iter_remove(&f_iter);
free(finfo->name);
free(finfo);
}
- g_hash_table_remove(entry->dir_hash, dkey);
+ g_hash_table_iter_remove(&d_iter);
free(dinfo->name);
if (dinfo->file_hash)
g_hash_table_destroy(dinfo->file_hash);