to avoid gdbus blocking issue, call storage api after process forking accepted/tizen/unified/20191017.042739 submit/tizen/20191016.225912
authorWoongsuk Cho <ws77.cho@samsung.com>
Thu, 17 Oct 2019 01:33:02 +0000 (10:33 +0900)
committer이형주/Common Platform Lab(SR)/Staff Engineer/삼성전자 <leee.lee@samsung.com>
Thu, 17 Oct 2019 01:39:00 +0000 (10:39 +0900)
NativeLauncher/launcher/dotnet/dotnet_launcher.cc

index 16a9865..58092f7 100644 (file)
@@ -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");