From: Hwankyu Jhun Date: Tue, 20 Nov 2018 03:17:36 +0000 (+0900) Subject: Fix a return value of the internal function X-Git-Tag: submit/tizen/20181120.233131~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=27d1411e9dbff2f972d989c81b166e154ca86e48;p=platform%2Fcore%2Fapi%2Fpreference.git Fix a return value of the internal function If the errno is ENOENT, the function returns PREFERENCE_ERROR_NO_KEY. Change-Id: I1f8b277e526623b5b6f3f307fcb0ba6336b74f4b Signed-off-by: Hwankyu Jhun --- diff --git a/src/preference.c b/src/preference.c index 8643cf1..7f84f30 100644 --- a/src/preference.c +++ b/src/preference.c @@ -1503,8 +1503,9 @@ API int preference_unset_changed_cb(const char *key) return PREFERENCE_ERROR_IO_ERROR; } - if (_preference_kdb_del_notify(pKeyNode)) { - if (errno == ENOENT) { + func_ret = _preference_kdb_del_notify(pKeyNode); + if (func_ret != PREFERENCE_ERROR_NONE) { + if (func_ret == PREFERENCE_ERROR_NO_KEY) { LOGE("NO_KEY(0x%08x) : fail to find given key(%s)", PREFERENCE_ERROR_NO_KEY, key); _preference_keynode_free(pKeyNode); return PREFERENCE_ERROR_NO_KEY; diff --git a/src/preference_inoti.c b/src/preference_inoti.c index 77bccda..c8e10ce 100644 --- a/src/preference_inoti.c +++ b/src/preference_inoti.c @@ -377,7 +377,7 @@ int _preference_kdb_del_notify(keynode_t *keynode) if (access(path, F_OK) != 0) { if (errno == ENOENT) { ERR("_preference_kdb_del_notify : Key(%s) does not exist", keyname); - return PREFERENCE_ERROR_IO_ERROR; + return PREFERENCE_ERROR_NO_KEY; } }