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.
return -1;
}
- if (useDlog && !pluginHasLogControl()) {
+ if (!pluginHasLogControl()) {
if (initializeLogManager() < 0) {
_ERR("Failed to initnialize LogManager");
return -1;
// 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");