From 5498210f1f7e9c8b2dd8e94579c64ab14fb6f6a8 Mon Sep 17 00:00:00 2001 From: Minje Ahn Date: Mon, 14 Mar 2016 08:30:38 +0900 Subject: [PATCH] Fix error type Change-Id: I1aaf5070612c41978d7af09d636e2bfd9aea915e Signed-off-by: Minje Ahn --- src/ipc/media-thumb-ipc.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/ipc/media-thumb-ipc.c b/src/ipc/media-thumb-ipc.c index 8227f1d..cbbb7b0 100755 --- a/src/ipc/media-thumb-ipc.c +++ b/src/ipc/media-thumb-ipc.c @@ -768,10 +768,16 @@ int _media_thumb_send_request() /* Connecting to the thumbnail server */ if (connect(sock, (struct sockaddr*)&serv_addr, sizeof(serv_addr)) < 0) { thumb_stderror("connect"); + if (errno == EACCES) + err = MS_MEDIA_ERR_PERMISSION_DENIED; + else + err = MS_MEDIA_ERR_SOCKET_CONN; + g_io_channel_shutdown(channel, TRUE, NULL); g_io_channel_unref(channel); ms_ipc_delete_client_socket(&sock_info); - return MS_MEDIA_ERR_SOCKET_CONN; + + return err; } req_manager = (thumbReq *)g_queue_pop_head(g_manage_queue); @@ -882,10 +888,15 @@ int _media_thumb_raw_data_send_request() /* Connecting to the thumbnail server */ if (connect(sock, (struct sockaddr*)&serv_addr, sizeof(serv_addr)) < 0) { thumb_stderror("connect error"); + if (errno == EACCES) + err = MS_MEDIA_ERR_PERMISSION_DENIED; + else + err = MS_MEDIA_ERR_SOCKET_CONN; + g_io_channel_shutdown(channel, TRUE, NULL); g_io_channel_unref(channel); ms_ipc_delete_client_socket(&sock_info); - return MS_MEDIA_ERR_SOCKET_CONN; + return err; } req_manager = (thumbRawReq *)g_queue_pop_head(g_manage_raw_queue); -- 2.34.1