]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Fix for the bug 21939: WinTC5.1.4: Crash of Yacs at preparing the scheme
authorrnv <rnv@opencascade.com>
Wed, 22 Sep 2010 11:00:25 +0000 (11:00 +0000)
committerrnv <rnv@opencascade.com>
Wed, 22 Sep 2010 11:00:25 +0000 (11:00 +0000)
src/Container/SALOME_ContainerManager.cxx
src/Utils/Utils_Identity.py

index 497e0c1ed9e4ff278b6085491656488bc3381bd4..729a19e9bdbf6b67c7d7012200ba16c9253f1b0a 100644 (file)
@@ -406,7 +406,9 @@ SALOME_ContainerManager::GiveContainer(const Engines::ContainerParameters& param
 #ifdef WNT
   std::string logFilename=getenv("TEMP");
   logFilename += "\\";
+  std::string user = getenv( "USERNAME" );
 #else
+  std::string user = getenv( "USER" );
   std::string logFilename="/tmp";
   char* val = getenv("SALOME_TMP_DIR");
   if(val)
@@ -419,7 +421,7 @@ SALOME_ContainerManager::GiveContainer(const Engines::ContainerParameters& param
   }
   logFilename += "/";
 #endif
-  logFilename += _NS->ContainerName(params)+"_"+ resource_selected +"_"+getenv( "USER" ) ;
+  logFilename += _NS->ContainerName(params)+"_"+ resource_selected +"_"+user;
   std::ostringstream tmp;
   tmp << "_" << getpid();
   logFilename += tmp.str();
@@ -469,7 +471,7 @@ SALOME_ContainerManager::GiveContainer(const Engines::ContainerParameters& param
       // Setting log file name
       logFilename=":"+logFilename;
       logFilename="@"+Kernel_Utils::GetHostname()+logFilename;
-      logFilename=getenv( "USER" )+logFilename;
+      logFilename=user+logFilename;
       ret->logfilename(logFilename.c_str());
       RmTmpFile(_TmpFileName); // command file can be removed here
     }
index f7a9af42097fb5d685b5ed1aa7278623b2397597..e55406a31aaa26888f75d2dbbab2bf373671f244 100644 (file)
@@ -59,7 +59,7 @@ class Identity:
         self._adip =  socket.gethostbyname(self._machine) # IP adress        
         if sys.platform == "win32":
           self._uid  = os.getpid() 
-          self._pwname = os.environ["USER"]
+          self._pwname = os.environ["USERNAME"]
         else:
           self._uid = os.getuid()
           list = pwd.getpwuid(self._uid)