Fix checking installed storage 98/97298/2 accepted/tizen/3.0/common/20161115.184604 accepted/tizen/3.0/ivi/20161114.070005 accepted/tizen/3.0/mobile/20161114.065857 accepted/tizen/3.0/tv/20161114.065920 accepted/tizen/3.0/wearable/20161114.065945 submit/tizen_3.0/20161113.234301
authorHwankyu Jhun <h.jhun@samsung.com>
Sun, 13 Nov 2016 22:50:40 +0000 (07:50 +0900)
committerHwanKyu Jhun <h.jhun@samsung.com>
Sun, 13 Nov 2016 22:53:58 +0000 (14:53 -0800)
- Use F_OK option instead of R_OK option

Change-Id: Ic2960c710348657c017d84e2e5a721a383e2208e
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/pkgmgrinfo_private.c

index 3c3c23a..4696af7 100644 (file)
@@ -472,14 +472,17 @@ char *_get_system_locale(void)
 int __pkginfo_check_installed_storage(package_x *pkginfo)
 {
        char buf[MAX_QUERY_LEN] = {'\0'};
+       int ret;
+
        retvm_if(pkginfo->package == NULL, PMINFO_R_OK, "pkgid is NULL\n");
        retvm_if(pkginfo->installed_storage == NULL, PMINFO_R_ERROR,
                        "installed_storage is NULL\n");
 
        if (strcmp(pkginfo->installed_storage, "installed_external") == 0) {
                snprintf(buf, MAX_QUERY_LEN - 1, "%s", pkginfo->external_path);
-               if (access(buf, R_OK) != 0) {
-                       _LOGE("can not access [%s]", buf);
+               ret = access(buf, F_OK);
+               if (ret != 0) {
+                       _LOGE("can not access [%s] - %d", buf, ret);
                        return PMINFO_R_ERROR;
                }
        }