Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
chord: avoid duplicate call of MSG_comm_test()
authorLucas Nussbaum <lucas.nussbaum@loria.fr>
Sun, 14 Oct 2012 10:56:09 +0000 (12:56 +0200)
committerLucas Nussbaum <lucas.nussbaum@loria.fr>
Sun, 14 Oct 2012 10:56:09 +0000 (12:56 +0200)
Commit caffead (exactly one year ago!) introduced a duplicate call to
MSG_comm_test(): MSG_comm_test() could return true on line 336, and
then be called again there. That caused a crash since the communication
was already finalized in the first MSG_comm_test() call.

examples/msg/chord/chord.c

index 5061abd..ec12796 100644 (file)
@@ -355,10 +355,7 @@ int node(int argc, char *argv[])
           // nothing to do: sleep for a while
           MSG_process_sleep(5);
         }
-      }
-
-      if (node.comm_receive && MSG_comm_test(node.comm_receive)) {
-
+      } else {
         // a transfer has occured
 
         msg_error_t status = MSG_comm_get_status(node.comm_receive);