Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Some cleanups, plus add some details to an error message
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sun, 7 Aug 2005 09:04:02 +0000 (09:04 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sun, 7 Aug 2005 09:04:02 +0000 (09:04 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1585 48e7efb5-ca39-0410-a469-dd3cf9ba447f

examples/gras/tokenS/tokenS.c

index 05b373c..bd0ec97 100644 (file)
@@ -92,15 +92,15 @@ static int node_cb_stoken_handler(gras_socket_t  expeditor,
      reused by our predecessor.
      Closing this side would thus create troubles */
   
-  /* 9. Decrease the remaining_loop integer. */
+  /* 8. Decrease the remaining_loop integer. */
   globals->remaining_loop -= 1;
    
-  /* 10. Repport the hop number to the user at the end */
+  /* 9. Repport the hop number to the user at the end */
   if (globals->remaining_loop == -1 && globals->create) {
     INFO1("Shut down the token-ring. There was %d hops.",msg);
   }
 
-  /* 11. Tell GRAS that we consummed this message */
+  /* 10. Tell GRAS that we consummed this message */
   return 1;
 } /* end_of_node_cb_stoken_handler */
 
@@ -169,8 +169,12 @@ int node (int argc,char *argv[]) {
     INFO3("Create the token (with value %d) and send it to %s:%d",
          token, host, peerport);
 
-    gras_msg_send(globals->tosuccessor,
-                 gras_msgtype_by_name("stoken"), &token);
+    TRY {        
+      gras_msg_send(globals->tosuccessor,
+                 gras_msgtype_by_name("stoken"), &token);
+    } CATCH(e) {
+      RETHROW0("Unable to send the freshly created token: %s");
+    }
   } 
   
   /* 8. Wait up to 10 seconds for an incomming message to handle */