Salome HOME
If you launch two salome sessions and try to execute a
authoradam <adam>
Fri, 30 Apr 2010 09:56:52 +0000 (09:56 +0000)
committeradam <adam>
Fri, 30 Apr 2010 09:56:52 +0000 (09:56 +0000)
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

index 4a63100d37619f45273f84a563e71fb1b6642e87..8245fe50b3d3ca220792cfc77be36081367b9ac5 100644 (file)
 #include "Utils_CorbaException.hxx"
 #include <sstream>
 
+#ifdef WNT
+#include <process.h>
+#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 + "', '')\"";