From: Hwankyu Jhun Date: Tue, 20 Nov 2018 07:32:50 +0000 (+0900) Subject: Add missing exceptions X-Git-Tag: submit/tizen/20181122.005315~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5d9e37f00fd8f3c0bc7b5b7abcf18d44c102904f;p=platform%2Fcore%2Fapi%2Fpreference.git Add missing exceptions If the errno is ENOENT, the internal function returns PREFERENCE_ERROR_NO_KEY. Change-Id: I22f0df4ef804d3dbebca544203229574d49434b0 Signed-off-by: Hwankyu Jhun --- diff --git a/src/preference_inoti.c b/src/preference_inoti.c index c8e10ce..92ad9fd 100644 --- a/src/preference_inoti.c +++ b/src/preference_inoti.c @@ -388,6 +388,8 @@ int _preference_kdb_del_notify(keynode_t *keynode) if (wd == -1) { strerror_r(errno, err_buf, sizeof(err_buf)); ERR("Error: inotify_add_watch() [%s]: %s", path, err_buf); + if (errno == ENOENT) + return PREFERENCE_ERROR_NO_KEY; return PREFERENCE_ERROR_IO_ERROR; } @@ -408,7 +410,10 @@ int _preference_kdb_del_notify(keynode_t *keynode) if (r == -1) { strerror_r(errno, err_buf, sizeof(err_buf)); ERR("Error: inotify_rm_watch [%s]: %s", keyname, err_buf); - func_ret = PREFERENCE_ERROR_IO_ERROR; + if (errno == ENOENT) + func_ret = PREFERENCE_ERROR_NO_KEY; + else + func_ret = PREFERENCE_ERROR_IO_ERROR; } INFO("key(%s) cb is removed. remained noti list total length(%d)", @@ -432,7 +437,7 @@ int _preference_kdb_del_notify(keynode_t *keynode) if (del == 0) { errno = ENOENT; - func_ret = PREFERENCE_ERROR_IO_ERROR; + func_ret = PREFERENCE_ERROR_NO_KEY; } return func_ret;