diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-09-14 15:11:07 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-09-14 15:11:07 +0200 |
commit | 67f3c40265471056d1e532c6d6e36a521b0a780a (patch) | |
tree | 5ad9713f97611ca2d3b665390546ee0fa2b93db4 /src/shared/hashmap.c | |
parent | 73836c5c430f48838fec2606b1729dda371edd2d (diff) |
systemctl: show unit name when a job fails
https://bugzilla.redhat.com/show_bug.cgi?id=845028
https://bugzilla.redhat.com/show_bug.cgi?id=846483
Diffstat (limited to 'src/shared/hashmap.c')
-rw-r--r-- | src/shared/hashmap.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/shared/hashmap.c b/src/shared/hashmap.c index 0a044b85ad..eb5c549e40 100644 --- a/src/shared/hashmap.c +++ b/src/shared/hashmap.c @@ -265,6 +265,8 @@ static void remove_entry(Hashmap *h, struct hashmap_entry *e) { void hashmap_free(Hashmap*h) { + /* Free the hashmap, but nothing in it */ + if (!h) return; @@ -277,6 +279,10 @@ void hashmap_free(Hashmap*h) { } void hashmap_free_free(Hashmap *h) { + + /* Free the hashmap and all data objects in it, but not the + * keys */ + if (!h) return; @@ -371,8 +377,8 @@ void* hashmap_get(Hashmap *h, const void *key) { return NULL; hash = h->hash_func(key) % NBUCKETS; - - if (!(e = hash_scan(h, hash, key))) + e = hash_scan(h, hash, key); + if (!e) return NULL; return e->value; |