From 6c5986089cec540782c013f067e6144ef8002afd Mon Sep 17 00:00:00 2001 From: adam Date: Fri, 30 Apr 2010 09:56:52 +0000 Subject: [PATCH] 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 ... --- src/Container/SALOME_ContainerManager.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 + "', '')\""; -- 2.39.2