From 3d865efe7e56ebd003a90883f73dd610294c9386 Mon Sep 17 00:00:00 2001 From: Woongsuk Cho Date: Wed, 3 Jul 2019 11:16:00 +0900 Subject: [PATCH] Change APP_NI_SUB_DIR from "/.native_image" to ".native_image" and use concatPath() function to combine path for APP_NI_SUB_DIR --- NativeLauncher/inc/launcher_env.h | 2 +- NativeLauncher/launcher/dotnet/dotnet_launcher.cc | 2 +- NativeLauncher/tool/ni_common.cc | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/NativeLauncher/inc/launcher_env.h b/NativeLauncher/inc/launcher_env.h index 55f600d..d202480 100644 --- a/NativeLauncher/inc/launcher_env.h +++ b/NativeLauncher/inc/launcher_env.h @@ -21,6 +21,6 @@ #define ENV_FILE_PATH "/usr/share/dotnet.tizen/lib/coreclr_env.list" #define AOT_METADATA_KEY "http://tizen.org/metadata/prefer_dotnet_aot" #define AOT_METADATA_VALUE "true" -#define APP_NI_SUB_DIR "/.native_image" +#define APP_NI_SUB_DIR ".native_image" #endif //__LAUNCHER_ENV_H_ \ No newline at end of file diff --git a/NativeLauncher/launcher/dotnet/dotnet_launcher.cc b/NativeLauncher/launcher/dotnet/dotnet_launcher.cc index 8ad60ed..35e8e0f 100644 --- a/NativeLauncher/launcher/dotnet/dotnet_launcher.cc +++ b/NativeLauncher/launcher/dotnet/dotnet_launcher.cc @@ -391,7 +391,7 @@ int CoreRuntime::initialize(bool standalone) std::string appLib = concatPath(appRoot, "lib"); std::string appTAC = concatPath(appBin, ".TAC.Release"); std::string probePath = appBin + ":" + appLib + ":" + appTAC; - std::string NIprobePath = appBin + APP_NI_SUB_DIR + ":" + appLib + APP_NI_SUB_DIR + ":" + appTAC; + std::string NIprobePath = concatPath(appBin, APP_NI_SUB_DIR) + ":" + concatPath(appLib, APP_NI_SUB_DIR) + ":" + appTAC; std::string tpa = getTPA(); std::string nativeLibPath = getExtraNativeLibDirs(appRoot) + ":" + appBin + ":" + appLib + ":" + __nativeLibDirectory; std::string appName = std::string("dotnet-launcher-") + std::to_string(getpid()); diff --git a/NativeLauncher/tool/ni_common.cc b/NativeLauncher/tool/ni_common.cc index 18f792d..1743c79 100644 --- a/NativeLauncher/tool/ni_common.cc +++ b/NativeLauncher/tool/ni_common.cc @@ -116,7 +116,7 @@ static std::string getAppNIPath(const std::string& niPath) std::string prevPath = niPath.substr(0, index); std::string fileName = niPath.substr(index, niPath.length()); - std::string niDirPath = prevPath + APP_NI_SUB_DIR; + std::string niDirPath = concatPath(prevPath, APP_NI_SUB_DIR); if (!isFileExist(niDirPath)) { if (mkdir(niDirPath.c_str(), 0755) == 0) { @@ -449,14 +449,14 @@ ni_error_e removeNiUnderPkgRoot(const std::string& pkgId) removeNiUnderDirs(paths, 2); - std::string binNIDir = binDir + APP_NI_SUB_DIR; + std::string binNIDir = concatPath(binDir, APP_NI_SUB_DIR); if (isFileExist(binNIDir)) { if (rmdir(binNIDir.c_str()) != 0) { fprintf(stderr, "Failed to remove app ni dir [%s]\n", binNIDir.c_str()); } } - std::string libNIDir = libDir + APP_NI_SUB_DIR; + std::string libNIDir = concatPath(libDir, APP_NI_SUB_DIR); if (isFileExist(libNIDir)) { if (rmdir(libNIDir.c_str()) != 0) { fprintf(stderr, "Failed to remove app ni dir [%s]\n", libNIDir.c_str()); -- 2.7.4