From: prascle Date: Fri, 5 Oct 2007 13:22:54 +0000 (+0000) Subject: PR: abort if SALOME_BATCH not defined X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f7307a9fc97226b34090212c170f1321bc4a0aa0;p=modules%2Fkernel.git PR: abort if SALOME_BATCH not defined --- diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index 1f7ce8910..0fc39bd91 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -449,12 +449,14 @@ GiveContainer(const Engines::MachineParameters& params, Engines::ResPolicy policy, const Engines::CompoList& componentList) { - if(strcmp(getenv("SALOME_BATCH"),"1")==0) - { - if(_batchLaunchedContainers.empty()) - fillBatchLaunchedContainers(); - return *(_batchLaunchedContainersIter++); - } + char *valenv=getenv("SALOME_BATCH"); + if(valenv) + if (strcmp(valenv,"1")==0) + { + if(_batchLaunchedContainers.empty()) + fillBatchLaunchedContainers(); + return *(_batchLaunchedContainersIter++); + } return StartContainer(params,policy,componentList); } diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx index 136f153c6..9877b1bda 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx @@ -234,19 +234,21 @@ Engines::Component_ptr SALOME_LifeCycleCORBA::FindOrLoad_Component(const char *containerName, const char *componentName) { - if(strcmp(getenv("SALOME_BATCH"),"1")==0) - { - MESSAGE("SALOME_LifeCycleCORBA::FindOrLoad_Component BATCH " << containerName << " " << componentName ) ; - _NS->Change_Directory("/Containers"); - CORBA::Object_ptr obj=_NS->Resolve(containerName); - Engines::Container_var cont=Engines::Container::_narrow(obj); - bool isLoadable = cont->load_component_Library(componentName); - if (!isLoadable) return Engines::Component::_nil(); - - Engines::Component_ptr myInstance = - cont->create_component_instance(componentName, 0); - return myInstance; - } + char *valenv=getenv("SALOME_BATCH"); + if(valenv) + if (strcmp(valenv,"1")==0) + { + MESSAGE("SALOME_LifeCycleCORBA::FindOrLoad_Component BATCH " << containerName << " " << componentName ) ; + _NS->Change_Directory("/Containers"); + CORBA::Object_ptr obj=_NS->Resolve(containerName); + Engines::Container_var cont=Engines::Container::_narrow(obj); + bool isLoadable = cont->load_component_Library(componentName); + if (!isLoadable) return Engines::Component::_nil(); + + Engines::Component_ptr myInstance = + cont->create_component_instance(componentName, 0); + return myInstance; + } MESSAGE("SALOME_LifeCycleCORBA::FindOrLoad_Component INTERACTIF " << containerName << " " << componentName ) ; //#if 0 // --- Check if Component Name is known in ModuleCatalog