]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
PR: abort if SALOME_BATCH not defined
authorprascle <prascle>
Fri, 5 Oct 2007 13:22:54 +0000 (13:22 +0000)
committerprascle <prascle>
Fri, 5 Oct 2007 13:22:54 +0000 (13:22 +0000)
src/Container/SALOME_ContainerManager.cxx
src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx

index 1f7ce89100e4fad0b4816025e2da906e5ae09c90..0fc39bd912008bbc000ac732b94cb1abce3bd93a 100644 (file)
@@ -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);
 }
 
index 136f153c65dea52618d884d8c6c9f78b87fa8c97..9877b1bda2b578798f2158111a531387b0c74fd7 100644 (file)
@@ -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