Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Dig through git history, and update copyright lines.
[simgrid.git] / src / simix / smx_host.c
index c113725..5b7b0e9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2012. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -34,8 +34,8 @@ smx_host_t SIMIX_host_create(const char *name,
 
   /* Update global variables */
   xbt_lib_set(host_lib,name,SIMIX_HOST_LEVEL,smx_host);
-  
-  return xbt_lib_get_elm_or_null(host_lib, name);
+
+  return xbt_lib_get_or_null(host_lib, name, SIMIX_HOST_LEVEL);
 }
 
 /**
@@ -322,7 +322,10 @@ void SIMIX_host_restart_processes(smx_host_t host)
 {
   unsigned int cpt;
   smx_process_arg_t arg;
-  xbt_dynar_foreach(SIMIX_host_priv(host)->auto_restart_processes,cpt,arg) {
+  xbt_dynar_t process_list = SIMIX_host_priv(host)->auto_restart_processes;
+  if(!process_list) return;
+
+  xbt_dynar_foreach(process_list,cpt,arg) {
 
     smx_process_t process;
 
@@ -353,7 +356,7 @@ void SIMIX_host_restart_processes(smx_host_t host)
 
     }
   }
-  xbt_dynar_reset(SIMIX_host_priv(host)->auto_restart_processes);
+  xbt_dynar_reset(process_list);
 }
 
 void SIMIX_host_autorestart(smx_host_t host)