Fix the log position to avoid errno change for thumbnail_util_extract_to_xxx() 46/197146/4 accepted/tizen/unified/20190111.055142 submit/tizen/20190109.233706
authorjiyong.min <jiyong.min@samsung.com>
Wed, 9 Jan 2019 23:15:54 +0000 (08:15 +0900)
committerjiyong.min <jiyong.min@samsung.com>
Thu, 10 Jan 2019 06:12:31 +0000 (15:12 +0900)
Change-Id: I30cb9b6c6d4afae79624195fd6a64bc179c953d4

src/thumbnail_util.c
test/thumbnail_util_test.c [changed mode: 0755->0644]

index 81e232deaa03c9502911ebaa7fd6ea8c30524190..3f8218fac651e4dc9f4131cc4f9b2d4e7dbc2f87 100755 (executable)
@@ -497,11 +497,13 @@ int _thumbnail_util_check_media_type(const char *path, thumbnail_util_media_type
        thumbnail_util_retv_if(path == NULL, THUMBNAIL_UTIL_ERROR_INVALID_PARAMETER);
        exist = open(path, O_RDONLY);
        if (exist < 0) {
-               thumbnail_util_error("Fail to open path[%s]", path);
-               if (errno == EACCES || errno == EPERM)
+               if (errno == EACCES || errno == EPERM) {
+                       thumbnail_util_error("Fail to open path: Permission Denied [%s]", path);
                        return  THUMBNAIL_UTIL_ERROR_PERMISSION_DENIED;
-               else
+               } else {
+                       thumbnail_util_error("Fail to open path: Invalid Path [%s]", path);
                        return THUMBNAIL_UTIL_ERROR_INVALID_PARAMETER;
+               }
        }
        close(exist);
 
old mode 100755 (executable)
new mode 100644 (file)
index 546b13e..dd86720
@@ -88,6 +88,8 @@ gboolean extract_thumbnail_start(gpointer data)
        thumbnail_util_set_path(test_info, tzplatform_mkpath(TZ_USER_IMAGES, "test_image1.jpg"));
        thumbnail_util_set_size(test_info, 511, 288);
        ret = thumbnail_util_extract(test_info, thumbnail_completed_cb, test_info, &g_id);
+       if (ret != THUMBNAIL_UTIL_ERROR_NONE)
+               thumbnail_util_error("thumbnail_util_extract failed[%d]", ret);
 #endif
        thumbnail_util_destroy(test_info);