Change APP_NI_SUB_DIR from "/.native_image" to ".native_image"
authorWoongsuk Cho <ws77.cho@samsung.com>
Wed, 3 Jul 2019 02:16:00 +0000 (11:16 +0900)
committerWoongsuk Cho <ws77.cho@samsung.com>
Wed, 3 Jul 2019 02:16:00 +0000 (11:16 +0900)
and use concatPath() function to combine path for APP_NI_SUB_DIR

NativeLauncher/inc/launcher_env.h
NativeLauncher/launcher/dotnet/dotnet_launcher.cc
NativeLauncher/tool/ni_common.cc

index 55f600d..d202480 100644 (file)
@@ -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
index 8ad60ed..35e8e0f 100644 (file)
@@ -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());
index 18f792d..1743c79 100644 (file)
@@ -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());