X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=NativeLauncher%2Flauncher%2Flib%2Fdotnet_launcher.cc;h=7ed7f39fb3919236c4c49f57a94b6097cb596960;hb=728356fda3ee62c5cc3690498ccd3254297d659b;hp=5dc230426b7b3622364fbc98f479d33c4cfbf753;hpb=440fd9210d3216c13500675d1b7a30d14b6e674d;p=platform%2Fcore%2Fdotnet%2Flauncher.git diff --git a/NativeLauncher/launcher/lib/dotnet_launcher.cc b/NativeLauncher/launcher/lib/dotnet_launcher.cc index 5dc2304..7ed7f39 100644 --- a/NativeLauncher/launcher/lib/dotnet_launcher.cc +++ b/NativeLauncher/launcher/lib/dotnet_launcher.cc @@ -347,7 +347,7 @@ CoreRuntime::~CoreRuntime() dispose(); } -int CoreRuntime::initialize(LaunchMode launchMode, bool useDlog, const char* rootPath) +int CoreRuntime::initialize(LaunchMode launchMode) { // checkInjection checks dotnet-launcher run mode // At the moment, this mechanism is used only when the Memory Profiler is started. @@ -399,7 +399,7 @@ int CoreRuntime::initialize(LaunchMode launchMode, bool useDlog, const char* roo return -1; } - if (useDlog && !pluginHasLogControl()) { + if (!pluginHasLogControl()) { if (initializeLogManager() < 0) { _ERR("Failed to initnialize LogManager"); return -1; @@ -449,31 +449,22 @@ int CoreRuntime::initialize(LaunchMode launchMode, bool useDlog, const char* roo // To avoid gdbus blocking issue, below function should be called after fork() initEnvForSpecialFolder(); + __fd = open("/proc/self", O_DIRECTORY); + if (__fd < 0) { + _ERR("Failed to open /proc/self"); + return -1; + } + std::string tpa = getTPA(); std::string runtimeDir = getRuntimeDir(); std::string appName = std::string("dotnet-launcher-") + std::to_string(getpid()); - std::string probePath; - std::string NIprobePath; - std::string nativeLibPath; - - if (launchMode == LaunchMode::corerun) { - probePath = rootPath; - NIprobePath = rootPath; - nativeLibPath = rootPath; - } else { - __fd = open("/proc/self", O_DIRECTORY); - if (__fd < 0) { - _ERR("Failed to open /proc/self"); - return -1; - } - std::string appRoot = std::string("/proc/self/fd/") + std::to_string(__fd); - std::string appBin = concatPath(appRoot, "bin"); - std::string appLib = concatPath(appRoot, "lib"); - std::string appTac = concatPath(appBin, TAC_SYMLINK_SUB_DIR); - probePath = appRoot + ":" + appBin + ":" + appLib + ":" + appTac; - NIprobePath = concatPath(appBin, APP_NI_SUB_DIR) + ":" + concatPath(appLib, APP_NI_SUB_DIR) + ":" + appTac; - nativeLibPath = getExtraNativeLibDirs(appRoot) + ":" + appBin + ":" + appLib + ":" + __nativeLibDirectory + ":" + runtimeDir; - } + std::string appRoot = std::string("/proc/self/fd/") + std::to_string(__fd); + std::string appBin = concatPath(appRoot, "bin"); + std::string appLib = concatPath(appRoot, "lib"); + std::string appTac = concatPath(appBin, TAC_SYMLINK_SUB_DIR); + std::string probePath = appRoot + ":" + appBin + ":" + appLib + ":" + appTac; + std::string NIprobePath = concatPath(appBin, APP_NI_SUB_DIR) + ":" + concatPath(appLib, APP_NI_SUB_DIR) + ":" + appTac; + std::string nativeLibPath = getExtraNativeLibDirs(appRoot) + ":" + appBin + ":" + appLib + ":" + __nativeLibDirectory + ":" + runtimeDir; if (!initializeCoreClr(appName.c_str(), probePath.c_str(), NIprobePath.c_str(), nativeLibPath.c_str(), tpa.c_str())) { _ERR("Failed to initialize coreclr");