X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3dbd85b088e8b703aed28341f1e4fa455ba74f63..4f566b4572ad07940ea23d86d4af4abeaed7b4c7:/examples/msg/platform-failures/platform-failures.c?ds=sidebyside diff --git a/examples/msg/platform-failures/platform-failures.c b/examples/msg/platform-failures/platform-failures.c index 710b5f16dc..5e4428548a 100644 --- a/examples/msg/platform-failures/platform-failures.c +++ b/examples/msg/platform-failures/platform-failures.c @@ -93,7 +93,6 @@ static int master(int argc, char *argv[]) static int worker(int argc, char *argv[]) { - msg_task_t task = NULL; char mailbox[80]; long id= xbt_str_parse_int(argv[1], "Invalid argument %s"); @@ -102,13 +101,13 @@ static int worker(int argc, char *argv[]) while (1) { double time1 = MSG_get_clock(); + msg_task_t task = NULL; int retcode = MSG_task_receive( &(task), mailbox); double time2 = MSG_get_clock(); if (retcode == MSG_OK) { XBT_INFO("Received \"%s\"", MSG_task_get_name(task)); if (MSG_task_get_data(task) == FINALIZE) { MSG_task_destroy(task); - task = NULL; break; } if (time1 < *((double *) task->data)) @@ -119,11 +118,9 @@ static int worker(int argc, char *argv[]) if (retcode == MSG_OK) { XBT_INFO("\"%s\" done", MSG_task_get_name(task)); MSG_task_destroy(task); - task = NULL; } else if (retcode == MSG_HOST_FAILURE) { XBT_INFO("Gloups. The cpu on which I'm running just turned off!. See you!"); MSG_task_destroy(task); - task = NULL; return 0; } else { XBT_INFO("Hey ?! What's up ? ");