From 13205503e73b487a5578ff19631bd8d17eff0feb Mon Sep 17 00:00:00 2001 From: Youngjae Cho Date: Wed, 15 Jun 2022 13:25:37 +0900 Subject: [PATCH] hal-api: common: Do not treat "No such file or directory" as error log There might be an environment that naturally has no hal backend. For the environment, changed log level to info so that not to be confused as an error. Change-Id: Ia458d7ec6c5bc89cbe58a35df0f7d6343bceae66 Signed-off-by: Youngjae Cho --- src/hal-api-common.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/hal-api-common.c b/src/hal-api-common.c index 8273b72..d11226b 100644 --- a/src/hal-api-common.c +++ b/src/hal-api-common.c @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -146,6 +147,11 @@ static int __open_backend(struct __hal_module_info *info) info->module_name); ret = -EINVAL; goto err; + } else if (access(backend_library_name, F_OK) == -1) { + _I("%s: There is no backend library\n", + info->module_name); + ret = -ENOENT; + goto err; } if (!info->symbol_name) { @@ -292,12 +298,8 @@ static int __get_backend(enum hal_module module, void **data, } ret = __open_backend(info); - if (ret < 0) { - _E("%s: Failed to get the backend library by dlopen\n", - info->module_name); - ret = -EINVAL; + if (ret < 0) goto err; - } ret = __init_backend(info, data, NULL); if (ret < 0) { @@ -414,12 +416,8 @@ static int __get_backend_data(enum hal_module module, unsigned int *abi_version, } ret = __open_backend(info); - if (ret < 0) { - _E("%s: Failed to get the backend library by dlopen\n", - info->module_name); - ret = -EINVAL; + if (ret < 0) goto err_conf_exit; - } /* Return abi_verion of hal_backend structure */ if (!name_size && !vendor_size) { -- 2.7.4