From: secher Date: Thu, 3 Mar 2011 14:39:57 +0000 (+0000) Subject: clean warning message X-Git-Tag: Start_BR_19998_21191~34 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5c16b3e02dbb3afc35daf6b31522a542f4b9c140;p=modules%2Fkernel.git clean warning message --- diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index f2a5469a0..66577e1c1 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -86,11 +86,9 @@ SALOME_ContainerManager::SALOME_ContainerManager(CORBA::ORB_ptr orb, PortableSer #ifdef HAVE_MPI2 #ifdef WITHOPENMPI - std::string urifile = getenv("HOME"); - std::ostringstream mypid; - mypid << getpid(); - urifile += "/.urifile_" + mypid.str(); - setenv("OMPI_URI_FILE",urifile.c_str(),0); + std::stringstream urifile; + urifile << getenv("HOME") << "/.urifile_" << getpid(); + setenv("OMPI_URI_FILE",urifile.str().c_str(),1); if( getenv("OMPI_URI_FILE") != NULL ){ system("killall -q ompi-server"); std::string command; @@ -118,8 +116,12 @@ SALOME_ContainerManager::~SALOME_ContainerManager() #ifdef HAVE_MPI2 #ifdef WITHOPENMPI if( getenv("OMPI_URI_FILE") != NULL ){ - system("killall -q ompi-server"); - system("rm -f ${OMPI_URI_FILE}"); + int status=system("killall -q ompi-server"); + if(status!=0) + throw SALOME_Exception("Error when killing ompi-server"); + status=system("rm -f ${OMPI_URI_FILE}"); + if(status!=0) + throw SALOME_Exception("Error when removing urifile"); } #endif #endif