summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authorPaul Warren <pdw@ex-parrot.com>2022-10-09 22:07:55 +0100
committerPaul Warren <pdw@ex-parrot.com>2022-10-09 22:07:55 +0100
commitaee8e05f48f0ffee4a724c6bd582f51ca65b27f1 (patch)
tree76dab521c580e74095b55ba4c8ecf3c0561a9d2f /hash.c
parent8d76ef06d225c4d72db544b54ea1ef1a0e077967 (diff)
Show local process names.origin/proc-display
Patch from Mark Benjamin
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hash.c b/hash.c
index 1c500f1..340c206 100644
--- a/hash.c
+++ b/hash.c
@@ -69,7 +69,12 @@ hash_status_enum hash_find(hash_type* hash_table, void* key, void **rec) {
while (p && !hash_table->compare(p->key, key)) {
p = p->next;
}
- if (!p) return HASH_STATUS_KEY_NOT_FOUND;
+ if (!p) {
+ if (hash_table->not_found_callback != NULL) {
+ hash_table->not_found_callback((void *)hash_table);
+ }
+ return HASH_STATUS_KEY_NOT_FOUND;
+ }
*rec = p->rec;
return HASH_STATUS_OK;
}