aboutsummaryrefslogtreecommitdiff
path: root/ks_index.c
diff options
context:
space:
mode:
Diffstat (limited to 'ks_index.c')
-rw-r--r--ks_index.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ks_index.c b/ks_index.c
index 5bf2ce5..23ba8c1 100644
--- a/ks_index.c
+++ b/ks_index.c
@@ -171,8 +171,7 @@ hal_error_t hal_ks_index_find(hal_ks_index_t *ksi,
int where;
- if (!ks_find(ksi, name, chunk, hint, &where))
- return HAL_ERROR_KEY_NOT_FOUND;
+ int ok = ks_find(ksi, name, chunk, hint, &where);
if (blockno != NULL)
*blockno = ksi->index[where];
@@ -180,7 +179,7 @@ hal_error_t hal_ks_index_find(hal_ks_index_t *ksi,
if (hint != NULL)
*hint = where;
- return HAL_OK;
+ return ok ? HAL_OK : HAL_ERROR_KEY_NOT_FOUND;
}
hal_error_t hal_ks_index_find_range(hal_ks_index_t *ksi,