From cc1f5f074e4603931100786d96bf1107f1b87729 Mon Sep 17 00:00:00 2001 From: hj kim Date: Mon, 13 Jan 2020 12:03:45 +0900 Subject: [PATCH] Remove duplicated codes Change-Id: I38e7ffe94280e8f11d7e604b959130bc0502dcd6 --- src/server/media-server-device-block.c | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/src/server/media-server-device-block.c b/src/server/media-server-device-block.c index c804b3b..378ddb2 100644 --- a/src/server/media-server-device-block.c +++ b/src/server/media-server-device-block.c @@ -30,33 +30,6 @@ #include "media-server-db-manage.h" #include "media-server-device-block.h" -#ifndef _USE_DEVICED_DBUS -static int __ms_get_added_storage_path(const char *add_path, char **device_id) -{ - int ret = MS_MEDIA_ERR_NONE; - char *id = NULL; - - *device_id = NULL; - - /* read deive information */ - ret = ms_read_device_info(add_path, &id); - if (id == NULL) { - if (ret == MS_MEDIA_ERR_FILE_NOT_EXIST) { - ret = ms_genarate_uuid(&id); - ret = ms_write_device_info(add_path , id); - if (ret == MS_MEDIA_ERR_NONE) - *device_id = strdup(id); - } - } else { - *device_id = strdup(id); - } - - MS_SAFE_FREE(id); - - return ret; -} -#endif - int ms_storage_insert_handler(const char *mount_path, const char *mount_uuid) { int ret = MS_MEDIA_ERR_NONE; @@ -180,7 +153,7 @@ static void __ms_usb_add_event(const char *mount_path) if (mount_path != NULL) { MS_DBG_SWARN("added path [%s]", mount_path); - __ms_get_added_storage_path(mount_path, &storage_id); + ms_get_added_storage_path(mount_path, &storage_id); if (storage_id != NULL) { /* update storage information into media DB */ -- 2.7.4