Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
[simgrid.git] / examples / msg / process-suspend / process-suspend.c
index b4fb807..19184ef 100644 (file)
@@ -35,10 +35,8 @@ static int lazy_guy(int argc, char *argv[])
 /* The Dream master: */
 static int dream_master(int argc, char *argv[])
 {
-  msg_process_t lazy = NULL;
-
   XBT_INFO("Let's create a lazy guy."); /* - Create a lazy_guy process */
-  lazy = MSG_process_create("Lazy", lazy_guy, NULL, MSG_host_self());
+  msg_process_t lazy = MSG_process_create("Lazy", lazy_guy, NULL, MSG_host_self());
   XBT_INFO("Let's wait a little bit...");
   MSG_process_sleep(10.0);              /* - Wait for 10 seconds */
   XBT_INFO("Let's wake the lazy guy up! >:) BOOOOOUUUHHH!!!!");
@@ -73,8 +71,6 @@ static int dream_master(int argc, char *argv[])
 
 int main(int argc, char *argv[])
 {
-  msg_error_t res = MSG_OK;
-
   MSG_init(&argc, argv);
   xbt_assert(argc > 1, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
 
@@ -83,7 +79,7 @@ int main(int argc, char *argv[])
   xbt_dynar_t hosts = MSG_hosts_as_dynar();
   MSG_process_create("dream_master", dream_master, NULL, xbt_dynar_getfirst_as(hosts, msg_host_t));
   xbt_dynar_free(&hosts);
-  res = MSG_main();                 /* - Run the simulation */
+  msg_error_t res = MSG_main(); /* - Run the simulation */
 
   return res != MSG_OK;
 }