From 3048f34c0542db89e3f6ebc66ad9fce8999879c1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christophe=20Thi=C3=A9ry?= Date: Fri, 14 Oct 2011 17:54:51 +0200 Subject: [PATCH] Now that processes are terminated cleanly, this recv can fail --- examples/msg/actions/actions.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/msg/actions/actions.c b/examples/msg/actions/actions.c index a45db1fd84..ca75da4b3e 100644 --- a/examples/msg/actions/actions.c +++ b/examples/msg/actions/actions.c @@ -137,10 +137,13 @@ static void action_recv(const char *const *action) #endif XBT_DEBUG("Receiving: %s", name); - MSG_task_receive(&task, mailbox_name); + MSG_error_t res = MSG_task_receive(&task, mailbox_name); // MSG_task_receive(&task, MSG_process_get_name(MSG_process_self())); XBT_VERB("%s %f", name, MSG_get_clock() - clock); - MSG_task_destroy(task); + + if (res == MSG_OK) { + MSG_task_destroy(task); + } if (XBT_LOG_ISENABLED(actions, xbt_log_priority_verbose)) free(name); -- 2.20.1