summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinje Ahn <minje.ahn@samsung.com>2018-01-31 08:41:16 (GMT)
committerMinje Ahn <minje.ahn@samsung.com>2018-01-31 08:41:16 (GMT)
commit05a439dfaff5a37ef343f52be5698fde6278c310 (patch)
tree861e61522d692f9ac658db2ff62ddcb136f0e72e
parent5db1a5e180bf6761b3cf814d055b7ff34f20e26d (diff)
downloadlibmedia-thumbnail-05a439dfaff5a37ef343f52be5698fde6278c310.zip
libmedia-thumbnail-05a439dfaff5a37ef343f52be5698fde6278c310.tar.gz
libmedia-thumbnail-05a439dfaff5a37ef343f52be5698fde6278c310.tar.bz2
Modified return error valuerefs/changes/34/168834/1
Change-Id: I2d9d31b4780c2301e47aafa4d83866ff858f38d3 Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
-rwxr-xr-xserver/thumb-server-internal.c7
-rwxr-xr-xsrc/media-thumb-internal.c5
2 files changed, 7 insertions, 5 deletions
diff --git a/server/thumb-server-internal.c b/server/thumb-server-internal.c
index a4b1142..643f548 100755
--- a/server/thumb-server-internal.c
+++ b/server/thumb-server-internal.c
@@ -186,7 +186,6 @@ static gboolean __thumb_server_send_msg_to_agent(int msg_type)
serv_addr.sun_family = AF_UNIX;
SAFE_STRLCPY(serv_addr.sun_path, THUMB_COMM_SOCK_PATH, sizeof(serv_addr.sun_path));
-
/* Connecting to the thumbnail server */
if (connect(sock, (struct sockaddr*)&serv_addr, sizeof(serv_addr)) < 0) {
thumb_stderror("connect");
@@ -267,7 +266,7 @@ int _thumbnail_get_data(const char *origin_path, char *thumb_path)
thumb_retvm_if(err != MS_MEDIA_ERR_NONE, err, "_media_thumb_image failed");
} else if (file_type == THUMB_VIDEO_TYPE) {
err = _media_thumb_video(origin_path, thumb_path, THUMB_DEFAULT_WIDTH, THUMB_DEFAULT_HEIGHT, NULL);
- thumb_retvm_if(err != MS_MEDIA_ERR_NONE, MS_MEDIA_ERR_INTERNAL, "_media_thumb_video failed");
+ thumb_retvm_if(err != MS_MEDIA_ERR_NONE, err, "_media_thumb_video failed");
} else {
thumb_err("invalid file type");
return MS_MEDIA_ERR_THUMB_UNSUPPORTED;
@@ -289,7 +288,7 @@ int _thumbnail_get_raw_data(const char *origin_path, int *width, int *height, un
return MS_MEDIA_ERR_INVALID_PARAMETER;
}
- if (!g_file_test(origin_path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) {
+ if (!g_file_test(origin_path, G_FILE_TEST_IS_REGULAR)) {
thumb_err("Original path (%s) does not exist", origin_path);
return MS_MEDIA_ERR_INVALID_PARAMETER;
}
@@ -305,7 +304,7 @@ int _thumbnail_get_raw_data(const char *origin_path, int *width, int *height, un
thumb_retvm_if(err != MS_MEDIA_ERR_NONE, err, "_media_thumb_image failed");
} else if (file_type == THUMB_VIDEO_TYPE) {
err = _media_thumb_video(origin_path, NULL, thumb_width, thumb_height, &thumb_info);
- thumb_retvm_if(err != MS_MEDIA_ERR_NONE, MS_MEDIA_ERR_INTERNAL, "_media_thumb_video failed");
+ thumb_retvm_if(err != MS_MEDIA_ERR_NONE, err, "_media_thumb_video failed");
} else {
thumb_err("invalid file type");
return MS_MEDIA_ERR_THUMB_UNSUPPORTED;
diff --git a/src/media-thumb-internal.c b/src/media-thumb-internal.c
index 693293a..9ada79e 100755
--- a/src/media-thumb-internal.c
+++ b/src/media-thumb-internal.c
@@ -321,7 +321,10 @@ ERROR:
mm_util_destroy_handle(dst_img);
mm_file_destroy_content_attrs(content);
- return err;
+ if (err != MS_MEDIA_ERR_NONE)
+ return MS_MEDIA_ERR_INTERNAL;
+
+ return MS_MEDIA_ERR_NONE;
}
int _media_thumb_get_hash_name(const char *file_full_path, char *thumb_hash_path, size_t max_thumb_path, uid_t uid)