If the internal function returns a negative error value,
the preference_set_changed_cb function also returns the negative error value.
Change-Id: I781f86d91aabb8812fd5b0a8feca86bce62bbb97
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
return PREFERENCE_ERROR_IO_ERROR;
}
- if (_preference_kdb_add_notify(pKeyNode, callback, user_data)) {
- if (errno == ENOENT) {
+ func_ret = _preference_kdb_add_notify(pKeyNode, callback, user_data);
+ 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;
if (access(path, F_OK) != 0) {
if (errno == ENOENT) {
ERR("_preference_kdb_add_notify : Key(%s) does not exist", keyname);
- return PREFERENCE_ERROR_IO_ERROR;
+ return PREFERENCE_ERROR_NO_KEY;
}
}