A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some cleanups, plus add some details to an error message
[simgrid.git]
/
examples
/
gras
/
tokenS
/
tokenS.c
diff --git
a/examples/gras/tokenS/tokenS.c
b/examples/gras/tokenS/tokenS.c
index
05b373c
..
bd0ec97
100644
(file)
--- a/
examples/gras/tokenS/tokenS.c
+++ b/
examples/gras/tokenS/tokenS.c
@@
-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 */
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;
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);
}
if (globals->remaining_loop == -1 && globals->create) {
INFO1("Shut down the token-ring. There was %d hops.",msg);
}
- /* 1
1
. Tell GRAS that we consummed this message */
+ /* 1
0
. Tell GRAS that we consummed this message */
return 1;
} /* end_of_node_cb_stoken_handler */
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);
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 */
}
/* 8. Wait up to 10 seconds for an incomming message to handle */