From 01a29421d980bedd431456b9853f373bd45c4bd5 Mon Sep 17 00:00:00 2001 From: Minje Ahn Date: Thu, 1 Aug 2019 15:21:21 +0900 Subject: [PATCH] Change return type of dcm_svc_db_disconnect() sqlite3_close_v2() always returns SQLITE_OK. Therefore, it does not need to check the return value. Change-Id: Iaa787cb8a8fd247dd0011a2593bad5258c5d1efb Signed-off-by: Minje Ahn --- include/dcm_svc_db.h | 2 +- src/dcm_svc_db.c | 18 +++--------------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/include/dcm_svc_db.h b/include/dcm_svc_db.h index 08e17d1..1ff83bd 100755 --- a/include/dcm_svc_db.h +++ b/include/dcm_svc_db.h @@ -31,7 +31,7 @@ typedef enum { } dcm_face_scan_status_e; int dcm_svc_db_connect(uid_t uid); -int dcm_svc_db_disconnect(); +void dcm_svc_db_disconnect(); int dcm_svc_db_get_scan_image_info_by_path(const char *file_path, dcm_svc_item_s **scan_item); int dcm_svc_db_insert_face_to_db(const char *media_uuid, unsigned int x, unsigned int y, unsigned int w, unsigned int h, int orientation); int dcm_svc_db_insert_face_to_face_scan_list(dcm_svc_item_s *scan_item); diff --git a/src/dcm_svc_db.c b/src/dcm_svc_db.c index 9e46afc..ecf8544 100755 --- a/src/dcm_svc_db.c +++ b/src/dcm_svc_db.c @@ -90,26 +90,14 @@ int dcm_svc_db_connect(uid_t uid) return MS_MEDIA_ERR_NONE; } -int dcm_svc_db_disconnect(void) +void dcm_svc_db_disconnect(void) { - int ret = MS_MEDIA_ERR_NONE; - dcm_warn("media db handle: %p", db_handle); - if (db_handle != NULL) { - ret = media_db_disconnect(db_handle); - if (ret != MS_MEDIA_ERR_NONE) { - dcm_error("media_db_disconnect failed: %d", ret); - db_handle = NULL; - return ret; - } - } + if (db_handle) + media_db_disconnect(db_handle); db_handle = NULL; - - dcm_debug_fleave(); - - return MS_MEDIA_ERR_NONE; } int dcm_svc_db_get_scan_image_info_by_path(const char *file_path, dcm_svc_item_s **scan_item) -- 2.34.1