From 27f354a7874b965bf223832bdf9749504cd1a590 Mon Sep 17 00:00:00 2001 From: morganamilo Date: Wed, 6 Nov 2019 01:42:11 +0000 Subject: pacman+libalpm: handle search errors Previously, pacman treated no matches and an error during search the same. To fix this, alpm_db_search now returns its status as an int and instead takes the to be returned list as a param. Allowing front ends to easily differentiate between errors and no matches. Signed-off-by: morganamilo Signed-off-by: Allan McRae --- lib/libalpm/db.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/libalpm/db.h') diff --git a/lib/libalpm/db.h b/lib/libalpm/db.h index f17444e6..e7ad98f5 100644 --- a/lib/libalpm/db.h +++ b/lib/libalpm/db.h @@ -87,7 +87,8 @@ alpm_db_t *_alpm_db_new(const char *treename, int is_local); void _alpm_db_free(alpm_db_t *db); const char *_alpm_db_path(alpm_db_t *db); int _alpm_db_cmp(const void *d1, const void *d2); -alpm_list_t *_alpm_db_search(alpm_db_t *db, const alpm_list_t *needles); +int _alpm_db_search(alpm_db_t *db, const alpm_list_t *needles, + alpm_list_t **ret); alpm_db_t *_alpm_db_register_local(alpm_handle_t *handle); alpm_db_t *_alpm_db_register_sync(alpm_handle_t *handle, const char *treename, int level); -- cgit v1.2.3-24-g4f1b