From b252694ce6aafcdec2dd268196029f17ab0c6335 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Wed, 19 Oct 2016 02:00:43 -0400 Subject: Shake first round of bugs out of hal_rpc_pkey_match(). The filtering code for this function has not been tested yet. --- ks_index.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'ks_index.c') 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, -- cgit v1.2.3