diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2015-11-05 13:44:04 +0100 |
---|---|---|
committer | Michal Schmidt <mschmidt@redhat.com> | 2015-11-05 13:44:04 +0100 |
commit | 8d2ecdb2cf1bc5b1125e69deaa852c6791ab5a41 (patch) | |
tree | 05a61a75f78cf3199d59aeecfc885c100f2d3bc3 | |
parent | bcf5c276ccc3d854216d4cb4b79eb1d42b4f6cc3 (diff) |
journal: drop unnecessary write_catalog() parameter
write_catalog() use the hashmap only to get its size. The size is
already given in parameter 'n'.
-rw-r--r-- | src/journal/catalog.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/journal/catalog.c b/src/journal/catalog.c index 95a6857472..7f43a49bcf 100644 --- a/src/journal/catalog.c +++ b/src/journal/catalog.c @@ -319,7 +319,7 @@ int catalog_import_file(Hashmap *h, struct strbuf *sb, const char *path) { return 0; } -static long write_catalog(const char *database, Hashmap *h, struct strbuf *sb, +static long write_catalog(const char *database, struct strbuf *sb, CatalogItem *items, size_t n) { CatalogHeader header; _cleanup_fclose_ FILE *w = NULL; @@ -344,7 +344,7 @@ static long write_catalog(const char *database, Hashmap *h, struct strbuf *sb, memcpy(header.signature, CATALOG_SIGNATURE, sizeof(header.signature)); header.header_size = htole64(ALIGN_TO(sizeof(CatalogHeader), 8)); header.catalog_item_size = htole64(sizeof(CatalogItem)); - header.n_items = htole64(hashmap_size(h)); + header.n_items = htole64(n); r = -EIO; @@ -445,7 +445,7 @@ int catalog_update(const char* database, const char* root, const char* const* di assert(n == hashmap_size(h)); qsort_safe(items, n, sizeof(CatalogItem), catalog_compare_func); - r = write_catalog(database, h, sb, items, n); + r = write_catalog(database, sb, items, n); if (r < 0) log_error_errno(r, "Failed to write %s: %m", database); else |