Fix the log position to avoid errno change for thumbnail_util_extract_to_xxx() 55/197155/3 accepted/tizen/5.0/unified/20190129.064240 submit/tizen_5.0/20190125.044503
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:13:41 +0000 (06:13 +0000)
Change-Id: I30cb9b6c6d4afae79624195fd6a64bc179c953d4

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

index 329b759e8b42c9bb8cc6ab561b8b3f943b7a4e75..720092dfe55c24240a7c543de3e4e38df2e1b56f 100755 (executable)
@@ -465,11 +465,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 abbf343..27f8525
@@ -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);