From: Sangyoon Jang Date: Mon, 8 Jun 2015 07:30:39 +0000 (+0900) Subject: Add missing api from Tizen 2.4 X-Git-Tag: accepted/tizen/3.0.2015.q2/common/20150609.181954^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cc8a60f9c7b8514a256d1b16354d168a9c382e84;p=platform%2Fcore%2Fappfw%2Fvconf-buxton.git Add missing api from Tizen 2.4 added: vconf_get_ext_errno to get more specific error code Change-Id: I377b02d42515ee718b20cd5511ca747439f86fd2 Signed-off-by: Sangyoon Jang --- diff --git a/include/vconf-buxton.h b/include/vconf-buxton.h index 2ad453d..504f846 100644 --- a/include/vconf-buxton.h +++ b/include/vconf-buxton.h @@ -85,12 +85,18 @@ * @{ */ +#include #include "vconf-buxton-keys.h" #ifdef __cplusplus extern "C" { #endif +#define VCONF_OK 0 +#define VCONF_ERROR -1 +#define VCONF_ERROR_FILE_NO_ENT -ENOENT +#define VCONF_ERROR_FILE_PERM -EPERM + /** * @brief Enumeration for uses of vconf_get(). * @since_tizen 2.3 @@ -1206,6 +1212,15 @@ int main() int vconf_exists(const char *keyname); /** + * This function returns result of last api call + * @return The result of last api call + * @retval #VCONF_OK Successful + * @retval #VCONF_ERROR General error + * @retval #VCONF_ERROR_FILE_NO_ENT No such key + * @retval #VCONF_ERROR_FILE_PERM Permission denied + */ + int vconf_get_ext_errno(void); +/** * @} */ diff --git a/src/vconf-buxton.c b/src/vconf-buxton.c index ea6a232..db3731e 100644 --- a/src/vconf-buxton.c +++ b/src/vconf-buxton.c @@ -57,9 +57,6 @@ #include "vconf-buxton.h" #include "log.h" -#define VCONF_OK 0 -#define VCONF_ERROR -1 - /*================= SECTION definition of types =============*/ /* @@ -239,6 +236,11 @@ static int internal_list_count = 0; static GSource *glib_source = NULL; #endif +/* + * error code for vconf_get_ext_errno() + */ +static int g_vconf_errno = 0; + #if !defined(NO_MULTITHREADING) /* * multithreaded protection @@ -679,7 +681,7 @@ _cb_inc_received_ (BuxtonResponse resp, keynode_t * keynode) list = keynode->list; list->cb_received++; - if (buxton_response_status (resp) != 0) + if ((g_vconf_errno = buxton_response_status (resp)) != 0) { ERR ("Buxton returned error %d for key %s", buxton_response_status (resp), keynode->keyname); @@ -761,7 +763,7 @@ _cb_refresh_ (BuxtonResponse resp, keynode_t * keynode) list = keynode->list; list->cb_received++; - if (buxton_response_status (resp) != 0) + if ((g_vconf_errno = buxton_response_status (resp)) != 0) { ERR ("Error %d while getting buxton key %s", buxton_response_status (resp), keynode->keyname); @@ -790,7 +792,7 @@ _cb_scan_ (BuxtonResponse resp, struct scanning_data *data) /* * check the response status */ - if (buxton_response_status (resp) != 0) + if ((g_vconf_errno = buxton_response_status (resp)) != 0) { ERR ("Error while getting list of names from buxton"); data->cb_status = VCONF_ERROR; @@ -2085,3 +2087,10 @@ vconf_get_str (const char *keyname) return single.node.value.s; } + +int +vconf_get_ext_errno (void) +{ + INFO("vconf errno: %d", g_vconf_errno); + return g_vconf_errno; +}