From 1aea870a67012d3c33083a8cf6918afec00e6ea5 Mon Sep 17 00:00:00 2001 From: Minje Ahn Date: Wed, 30 Jan 2019 10:38:56 +0900 Subject: [PATCH] Add missing handle Change-Id: I44ad612035319fb7366e31a7d9b1e05c8c8b1ed9 Signed-off-by: Minje Ahn --- src/common/include/media-common-db-svc.h | 4 ++-- src/common/media-common-db-svc.c | 4 ++-- src/server/media-server-device-block.c | 2 +- src/server/media-server-main.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/include/media-common-db-svc.h b/src/common/include/media-common-db-svc.h index 2eeacad..0ea8dda 100755 --- a/src/common/include/media-common-db-svc.h +++ b/src/common/include/media-common-db-svc.h @@ -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); diff --git a/src/common/media-common-db-svc.c b/src/common/media-common-db-svc.c index a02759a..a08176d 100755 --- a/src/common/media-common-db-svc.c +++ b/src/common/media-common-db-svc.c @@ -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)); } diff --git a/src/server/media-server-device-block.c b/src/server/media-server-device-block.c index 31c3770..dbe947f 100755 --- a/src/server/media-server-device-block.c +++ b/src/server/media-server-device-block.c @@ -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); diff --git a/src/server/media-server-main.c b/src/server/media-server-main.c index 0e5bf66..2805a65 100755 --- a/src/server/media-server-main.c +++ b/src/server/media-server-main.c @@ -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 -- 2.7.4