From: pr.jung Date: Fri, 15 Feb 2019 08:57:38 +0000 (+0900) Subject: Modify external-storage and extended-internal-sd directory paths X-Git-Tag: submit/tizen/20190311.020751~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5dd6918216b959e05f95347eed9c6222f3072025;p=platform%2Fcore%2Fsystem%2Fstoraged.git Modify external-storage and extended-internal-sd directory paths Change-Id: Ibb92488d33812d8d0ff3fecd9c0e4016a44aa064 Signed-off-by: pr.jung --- diff --git a/CMakeLists.txt b/CMakeLists.txt index b83887c..8410163 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,7 @@ SET(STORAGED_APPS ${CMAKE_SOURCE_DIR}/apps) SET(SRCS src/core/main.c src/core/modules.c + src/shared/common.c ) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/src) diff --git a/src/block/block.c b/src/block/block.c index 0102eea..87ffc88 100644 --- a/src/block/block.c +++ b/src/block/block.c @@ -94,8 +94,8 @@ #define BLOCK_CONF_FILE "/etc/storaged/block.conf" -#define EXTERNAL_STORAGE_PATH "/run/external-storage" -#define EXTENDED_INTERNAL_PATH "/run/extended-internal-sd" +#define EXTERNAL_STORAGE_PATH "/run/storaged/external-storage" +#define EXTENDED_INTERNAL_PATH "/run/storaged/extended-internal-sd" #define PATH_LEN 55 #define EXTENDEDSD_MOUNT_PATH "/opt/extendedsd" diff --git a/src/core/main.c b/src/core/main.c index 3a202d1..2cacc53 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -24,11 +24,15 @@ #include #include #include +#include +#include #include "log.h" #include "modules.h" +#include "storaged_common.h" #define WATCHDOG_TIMEOUT 15 /* Seconds */ +#define STORAGED_DIR_PATH "/run/storaged" static GMainLoop *loop; @@ -64,6 +68,19 @@ static void dbus_name_acquired(GDBusConnection *connection, const gchar *name, g sd_notify(0, "READY=1"); } +static void dir_init(void) +{ + int ret; + + ret = remove_directory(STORAGED_DIR_PATH); + if (ret < 0) + _E("Failed to remove directory"); + ret = mkdir(STORAGED_DIR_PATH, 0644); + if (ret < 0) + _E("Failed to make directory: %d", errno); + +} + int main(int argc, char **argv) { int ret; @@ -80,6 +97,7 @@ int main(int argc, char **argv) if (!handle) _E("Fail to get dbus connection");; + dir_init(); modules_init(NULL); ret = dbus_handle_request_bus_name(handle, STORAGED_BUS_NAME, dbus_name_acquired, NULL); diff --git a/src/storage/storage.c b/src/storage/storage.c index d4bbcac..4fde666 100644 --- a/src/storage/storage.c +++ b/src/storage/storage.c @@ -56,7 +56,6 @@ #define STORAGE_CONF_FILE "/etc/storaged/storage.conf" -#define STORAGED_DIR_PATH "/run/storaged" #define NEED_CLEANUP_DIR_PATH "/run/storaged/needcleanup" #define NEED_CLEANUP_FILE_PATH "/run/storaged/needcleanup/trigger" @@ -728,13 +727,6 @@ static void storage_init(void *data) if (ret < 0) _E("Failed to register dbus interface and methods(%d)", ret); - ret = remove_directory(STORAGED_DIR_PATH); - if (ret < 0) - _E("Failed to remove directory"); - ret = mkdir(STORAGED_DIR_PATH, 0644); - if (ret < 0) - _E("Failed to make directory: %d", errno); - ret = remove_directory(NEED_CLEANUP_DIR_PATH); if (ret < 0) _E("Failed to remove directory");