From 33af1a5ccc926ea771f84e14133d0716972cd343 Mon Sep 17 00:00:00 2001 From: Agnieszka Baumann Date: Fri, 28 Aug 2020 15:56:17 +0200 Subject: [PATCH] libdlogutil: config failure now returns TIZEN_ERROR_IO_ERROR Instead of an arbitrary POSIX errno Change-Id: Ieeb3c93d8d72fa19322ac9a0f232800632b16ca9 --- include/dlogutil.h | 3 +++ src/libdlogutil/lib.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/dlogutil.h b/include/dlogutil.h index 4925f3e..492415d 100644 --- a/include/dlogutil.h +++ b/include/dlogutil.h @@ -344,6 +344,7 @@ int dlogutil_config_mode_set_dump(dlogutil_config_s *config, unsigned int entry_ * @retval TIZEN_ERROR_INVALID_PARAMETER Config was NULL * @retval TIZEN_ERROR_INVALID_PARAMETER No buffers selected * @retval TIZEN_ERROR_NOT_SUPPORTED Unsupported buffer set (KMSG + non-KMSG) + * @retval TIZEN_ERROR_IO_ERROR Couldn't read config file * @retval Other An arbitrary Tizen error code */ int dlogutil_config_connect(dlogutil_config_s *config, dlogutil_state_s **state_out); @@ -455,6 +456,7 @@ int dlogutil_buffer_get_usage(dlogutil_state_s *state, log_id_t buffer, unsigned * @retval TIZEN_ERROR_NONE Success * @retval TIZEN_ERROR_INVALID_PARAMETER Invalid buffer * @retval TIZEN_ERROR_INVALID_PARAMETER The pointer was NULL + * @retval TIZEN_ERROR_IO_ERROR Couldn't read config file * @retval Other An arbitrary Tizen error code */ int dlogutil_buffer_get_default_ts_type(log_id_t buffer, dlogutil_sorting_order_e *type); @@ -478,6 +480,7 @@ int dlogutil_buffer_get_default_ts_type(log_id_t buffer, dlogutil_sorting_order_ * @retval TIZEN_ERROR_INVALID_PARAMETER Invalid buffer * @retval TIZEN_ERROR_INVALID_PARAMETER More than one buffer * @retval TIZEN_ERROR_INVALID_PARAMETER The pointer was NULL + * @retval TIZEN_ERROR_IO_ERROR Couldn't read config file */ int dlogutil_buffer_check_ts_type_available(log_id_t buffer, dlogutil_sorting_order_e type, bool *available); diff --git a/src/libdlogutil/lib.c b/src/libdlogutil/lib.c index 6ff30b3..e9525a0 100644 --- a/src/libdlogutil/lib.c +++ b/src/libdlogutil/lib.c @@ -185,7 +185,7 @@ EXPORT_API int dlogutil_config_connect(dlogutil_config_s *config, dlogutil_state __attribute__ ((cleanup(log_config_free))) struct log_config conf = { .begin = NULL, .last = NULL }; int r = log_config_read(&conf); if (r < 0) - return r; + return TIZEN_ERROR_IO_ERROR; bool is_pipe; r = check_is_pipe(&conf, &is_pipe); @@ -327,7 +327,7 @@ EXPORT_API int dlogutil_buffer_get_default_ts_type(log_id_t buffer, dlogutil_sor __attribute__ ((cleanup(log_config_free))) struct log_config conf = { .begin = NULL, .last = NULL }; int r = log_config_read(&conf); if (r < 0) - return r; + return TIZEN_ERROR_IO_ERROR; bool is_pipe; r = check_is_pipe(&conf, &is_pipe); @@ -347,7 +347,7 @@ EXPORT_API int dlogutil_buffer_check_ts_type_available(log_id_t buffer, dlogutil __attribute__ ((cleanup(log_config_free))) struct log_config conf = { .begin = NULL, .last = NULL }; int r = log_config_read(&conf); if (r < 0) - return r; + return TIZEN_ERROR_IO_ERROR; bool is_pipe; r = check_is_pipe(&conf, &is_pipe); -- 2.7.4