diff options
-rw-r--r-- | NativeLauncher/launcher/dotnet/dotnet_launcher.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/NativeLauncher/launcher/dotnet/dotnet_launcher.cc b/NativeLauncher/launcher/dotnet/dotnet_launcher.cc index 16a9865..58092f7 100644 --- a/NativeLauncher/launcher/dotnet/dotnet_launcher.cc +++ b/NativeLauncher/launcher/dotnet/dotnet_launcher.cc @@ -344,9 +344,6 @@ int CoreRuntime::preinitialize(bool standalone) // read string from external file and set them to environment value. setEnvFromFile(); - // Set environment for System.Environment.SpecialFolder - initEnvForSpecialFolder(); - if (initializePathManager(std::string(), std::string(), std::string()) < 0) { _ERR("Failed to initialize PathManager"); return -1; @@ -439,6 +436,12 @@ int CoreRuntime::initialize(bool standalone) if (!standalone) pluginPreload(); + // Set environment for System.Environment.SpecialFolder + // Below function creates dbus connection by callging storage API. + // If dbus connection is created bofere fork(), forked process cannot use dbus. + // To avoid gdbus blocking issue, below function should be called after fork() + initEnvForSpecialFolder(); + fd = open("/proc/self", O_DIRECTORY); std::string appRoot = std::string("/proc/self/fd/") + std::to_string(fd); std::string appBin = concatPath(appRoot, "bin"); |