From: Woongsuk Cho Date: Thu, 17 Oct 2019 01:33:02 +0000 (+0900) Subject: to avoid gdbus blocking issue, call storage api after process forking X-Git-Tag: submit/tizen/20191016.225912^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6f10c216e1514a865b6cfcfc883847da73994277;p=platform%2Fcore%2Fdotnet%2Flauncher.git to avoid gdbus blocking issue, call storage api after process forking --- 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");