From: adam Date: Fri, 30 Apr 2010 09:56:52 +0000 (+0000) Subject: If you launch two salome sessions and try to execute a X-Git-Tag: V5_1_4rc1~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6c5986089cec540782c013f067e6144ef8002afd;p=modules%2Fkernel.git If you launch two salome sessions and try to execute a YACS graph in each one, you have to start a container, the traces are redirected in a log file with the same name ... The file is overwritten on linux whereas on windows it generates an error since the file is locked ... On windows, I complete the file with the pid ... --- diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index 4a63100d3..8245fe50b 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -34,6 +34,11 @@ #include "Utils_CorbaException.hxx" #include +#ifdef WNT +#include +#define getpid _getpid +#endif + #ifdef WITH_PACO_PARALLEL #include "PaCOPP.hxx" #endif @@ -414,7 +419,13 @@ SALOME_ContainerManager::GiveContainer(const Engines::ContainerParameters& param } logFilename += "/"; #endif - logFilename += _NS->ContainerName(params)+"_"+ resource_selected +"_"+getenv( "USER" )+".log" ; + logFilename += _NS->ContainerName(params)+"_"+ resource_selected +"_"+getenv( "USER" ) ; +#ifdef WNT + std::ostringstream tmp; + tmp << "_" << getpid(); + logFilename += tmp.str(); +#endif + logFilename += ".log" ; command += " > " + logFilename + " 2>&1"; #ifdef WNT command = "%PYTHONBIN% -c \"import win32pm ; win32pm.spawnpid(r'" + command + "', '')\"";