Add missing handle 04/198804/1
authorMinje Ahn <minje.ahn@samsung.com>
Wed, 30 Jan 2019 01:38:56 +0000 (10:38 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Wed, 30 Jan 2019 01:38:56 +0000 (10:38 +0900)
Change-Id: I44ad612035319fb7366e31a7d9b1e05c8c8b1ed9
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
src/common/include/media-common-db-svc.h
src/common/media-common-db-svc.c
src/server/media-server-device-block.c
src/server/media-server-main.c

index 2eeacad..0ea8dda 100755 (executable)
@@ -83,7 +83,7 @@ typedef int (*CHECK_STORAGE)(sqlite3 *, const char *, char **, int *, uid_t);
 typedef int (*INSERT_STORAGE)(sqlite3 *, const char *, int, const char *, uid_t);
 typedef int (*UPDATE_STORAGE)(sqlite3 *, const char *, const char *, uid_t);
 typedef int (*SET_STORAGE_VALIDITY)(sqlite3 *, const char *, int, uid_t uid);
-typedef int (*SET_ALL_STORAGE_VALIDITY)(int, uid_t);
+typedef int (*SET_ALL_STORAGE_VALIDITY)(sqlite3 *, int, uid_t);
 
 typedef int (*UPDATE_ITEM_META)(const char *, const char *, int, uid_t);
 typedef int (*UPDATE_ITEM_BEGIN)(int);
@@ -129,7 +129,7 @@ int ms_check_storage(sqlite3 *handle, const char *storage_id, char **storage_pat
 int ms_insert_storage(sqlite3 *handle, const char *storage_id, const char *storage_path, uid_t uid);
 int ms_update_storage(sqlite3 *handle, const char *storage_id, const char *storage_path, uid_t uid);
 int ms_set_storage_validity(sqlite3 *handle, const char *storage_id, int validity, uid_t uid);
-int ms_set_all_storage_validity(int validity, uid_t uid);
+int ms_set_all_storage_validity(sqlite3 *handle, int validity, uid_t uid);
 int ms_update_meta_batch(const char *path, const char *storage_id, uid_t uid);
 int ms_delete_invalid_folder_by_path(sqlite3 *handle, const char *storage_id, const char *folder_path, uid_t uid);
 int ms_check_folder_exist(sqlite3 *handle, const char *storage_id, const char *folder_path);
index a02759a..a08176d 100755 (executable)
@@ -859,13 +859,13 @@ int ms_set_storage_validity(sqlite3 *handle, const char *storage_id, int validit
        return ret;
 }
 
-int ms_set_all_storage_validity(int validity, uid_t uid)
+int ms_set_all_storage_validity(sqlite3 *handle, int validity, uid_t uid)
 {
        int lib_index;
        int ret = MS_MEDIA_ERR_NONE;
 
        for (lib_index = 0; lib_index < lib_num; lib_index++) {
-               ret = ((SET_ALL_STORAGE_VALIDITY)func_array[lib_index][eSET_ALL_STORAGE_VALIDITY])(validity, uid); /*dlopen*/
+               ret = ((SET_ALL_STORAGE_VALIDITY)func_array[lib_index][eSET_ALL_STORAGE_VALIDITY])(handle, validity, uid); /*dlopen*/
                MS_DBG_RETVM_IF(ret != MS_MEDIA_ERR_NONE, ret, "Error : %s", g_array_index(so_array, char*, lib_index));
        }
 
index 31c3770..dbe947f 100755 (executable)
@@ -165,7 +165,7 @@ int ms_storage_remove_handler(const char *mount_path, const char *mount_uuid)
 
                ms_sys_get_uid(&uid);
                ms_connect_db(&handle, uid);
-               ms_set_all_storage_validity(0, uid);
+               ms_set_all_storage_validity(handle, 0, uid);
 
                ms_disconnect_db(handle);
 
index 0e5bf66..2805a65 100755 (executable)
@@ -759,7 +759,7 @@ static void __ms_check_mediadb(void)
                MS_DBG_ERR("ms_set_storage_scan_status fail");
 
        /*update just valid type*/
-       if (ms_set_all_storage_validity(0, uid) != MS_MEDIA_ERR_NONE)
+       if (ms_set_all_storage_validity(db_handle, 0, uid) != MS_MEDIA_ERR_NONE)
                MS_DBG_ERR("ms_set_all_storage_validity fail");
 
 #ifdef _USE_TVPD_MODE