From eec919923573ee8ff7010e1fea4531c5a752b87f Mon Sep 17 00:00:00 2001 From: Yong Yeon Kim Date: Thu, 3 Nov 2016 21:39:01 +0900 Subject: [PATCH] 1. remove unusing code 2. change the position of reqest to scan senior mode Change-Id: I1b654dcba09d50be81f43b6331a7a3345acc3560 --- src/server/media-server-main.c | 56 ++++++------------------------------------ 1 file changed, 8 insertions(+), 48 deletions(-) diff --git a/src/server/media-server-main.c b/src/server/media-server-main.c index b9e26b4..5f3e34e 100644 --- a/src/server/media-server-main.c +++ b/src/server/media-server-main.c @@ -535,46 +535,6 @@ static void __ms_add_signal_handler(void) } //////////////////////////////////////////////////////////////////// -/* -static char* __ms_get_path(uid_t uid) -{ - int len = 0; - char *result_passwd = NULL; - struct group *grpinfo = NULL; - if (uid == getuid()) { - grpinfo = getgrnam("users"); - if (grpinfo == NULL) { - MS_DBG_ERR("getgrnam(users) returns NULL !"); - return NULL; - } - if (MS_STRING_VALID(MEDIA_ROOT_PATH_INTERNAL)) - result_passwd = strndup(MEDIA_ROOT_PATH_INTERNAL, strlen(MEDIA_ROOT_PATH_INTERNAL)); - } else { - char passwd_str[MAX_FILEPATH_LEN] = {0, }; - struct passwd *userinfo = getpwuid(uid); - if (userinfo == NULL) { - MS_DBG_ERR("getpwuid(%d) returns NULL !", uid); - return NULL; - } - grpinfo = getgrnam("users"); - if (grpinfo == NULL) { - MS_DBG_ERR("getgrnam(users) returns NULL !"); - return NULL; - } - // Compare git_t type and not group name - if (grpinfo->gr_gid != userinfo->pw_gid) { - MS_DBG_ERR("UID [%d] does not belong to 'users' group!", uid); - return NULL; - } - - len = snprintf(passwd_str, sizeof(passwd_str), "%s/%s", userinfo->pw_dir, MEDIA_CONTENT_PATH); - if (len > 0) - result_passwd = strndup(passwd_str, len); - } - - return result_passwd; -} -*/ #ifdef _USE_SDCARD static int __ms_check_mmc_status(void) { @@ -661,7 +621,7 @@ static void __ms_check_mediadb(void) ms_unload_functions(); return; } - + ret = ms_check_db_upgrade(db_handle, uid); if (ret != MS_MEDIA_ERR_NONE) { MS_DBG_ERR("ms_check_db_upgrade failed [%d]", ret); @@ -677,19 +637,19 @@ static void __ms_check_mediadb(void) if (ms_set_all_storage_validity(db_handle, 0, uid) != MS_MEDIA_ERR_NONE) MS_DBG_ERR("ms_set_all_storage_validity fail"); - ms_disconnect_db(&db_handle); - ms_unload_functions(); -#endif -/* - ms_sys_get_uid(&uid); - ms_send_storage_scan_request(__ms_get_path(uid), INTERNAL_STORAGE_ID, MS_SCAN_PART, uid); -*/ #ifdef _USE_SENIOR_MODE if(ms_is_support_senior_mode()) { ms_send_storage_scan_request_senior_mode(db_handle); } #endif + ms_disconnect_db(&db_handle); + ms_unload_functions(); +#endif +/* + ms_sys_get_uid(&uid); + ms_send_storage_scan_request(ms_get_path(uid), INTERNAL_STORAGE_ID, MS_SCAN_PART, uid); +*/ /* update external storage */ #ifdef _USE_SDCARD __ms_check_mmc_status(); -- 2.7.4