Modify the exception handling method when read fails. 77/93377/1
authorMinje Ahn <minje.ahn@samsung.com>
Mon, 24 Oct 2016 04:35:29 +0000 (13:35 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Mon, 24 Oct 2016 04:35:29 +0000 (13:35 +0900)
Change-Id: Ib6037f31bb7f6eb4c2e1aa6b1fd1a0aff16bef46
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
lib/media-util-db.c
lib/media-util-register.c
packaging/media-server.spec

index 1b58050..54b2711 100755 (executable)
@@ -88,7 +88,7 @@ static char* __media_get_media_DB(uid_t uid)
 
        ret = getgrnam_r("users", &grpinfo, grpbuf, grpbufsize, &grpresult);
        if((ret == 0) && (grpresult != NULL)) {
-               MSAPI_DBG_ERR("getgrnam_r users success...\n");
+               MSAPI_DBG("getgrnam_r users success...\n");
        } else {
                MSAPI_DBG_ERR("getgrnam_r users failed ret[%d]", ret);
                goto END;
@@ -96,7 +96,7 @@ static char* __media_get_media_DB(uid_t uid)
 
        if (uid == getuid()) {
                if (MS_STRING_VALID(MEDIA_DB_NAME)) {
-                       MSAPI_DBG_ERR("MS_STRING_VALID MEDIA_DB_NAME valid...\n");
+                       MSAPI_DBG("MS_STRING_VALID MEDIA_DB_NAME valid...\n");
                        result_passwd = strdup(MEDIA_DB_NAME);
                } else {
                        MSAPI_DBG_ERR("MS_STRING_VALID MEDIA_DB_NAME invalid...\n");
@@ -121,14 +121,14 @@ static char* __media_get_media_DB(uid_t uid)
 
                ret = getpwuid_r(uid, &pwdinfo, pwdbuf, pwdbufsize, &pwdresult);
                if((ret == 0) && (pwdresult != NULL)) {
-                       MSAPI_DBG_ERR("getpwuid uid[%d] success\n", uid);
+                       MSAPI_DBG("getpwuid uid[%d] success\n", uid);
                } else {
                        MSAPI_DBG_ERR("getpwuid uid[%d] failed ret[%d]", uid, ret);
                        MS_SAFE_FREE(pwdbuf);
                        goto END;
                }
 
-               MSAPI_DBG_ERR("grpinfo.gr_gid[%d], pwdinfo.pw_gid[%d]", grpinfo.gr_gid, pwdinfo.pw_gid);
+               MSAPI_DBG("grpinfo.gr_gid[%d], pwdinfo.pw_gid[%d]", grpinfo.gr_gid, pwdinfo.pw_gid);
                if(grpinfo.gr_gid != pwdinfo.pw_gid) {
                        MSAPI_DBG_ERR("UID [%d] does not belong to 'users' group![%d][%d]", uid, grpinfo.gr_gid, pwdinfo.pw_gid);
                        MS_SAFE_FREE(pwdbuf);
index 65ba596..54de79f 100755 (executable)
@@ -211,11 +211,7 @@ gboolean _read_socket(GIOChannel *src, GIOCondition condition, gpointer data)
 
        if ((recv_msg_size = read(sockfd, &recv_msg, sizeof(ms_comm_msg_s))) < 0) {
                MSAPI_DBG_STRERROR("recv failed");
-               req_result.pid = -1;
-               req_result.result = MS_MEDIA_ERR_SOCKET_RECEIVE;
-               req_result.complete_path = NULL;
-               req_result.request_type = -1;
-               goto ERROR;
+               return FALSE;
        }
 
        req_result.pid = recv_msg.pid;
index b9ad65d..70eaf81 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       media-server
 Summary:    A server for media content management
-Version:    0.3.3
+Version:    0.3.4
 Release:    0
 Group:      Multimedia/Service
 License:    Apache-2.0