- if (errcode == timeout_error && untiltimer < timeOut) {
- /* A timer elapsed before the arrival of any message even if we select()ed a bit */
- untiltimer = gras_msg_timer_handle();
- if (untiltimer == 0.0) {
- return no_error;
+ if (errcode == timeout_error ) {
+ if (timerexpected) {
+
+ /* A timer elapsed before the arrival of any message even if we select()ed a bit */
+ untiltimer = gras_msg_timer_handle();
+ if (untiltimer == 0.0) {
+ return no_error;
+ } else {
+ xbt_assert1(untiltimer>0, "Negative timer (%f). I'm puzzeled", untiltimer);
+ ERROR1("No timer elapsed, in contrary to expectations (next in %f sec)",
+ untiltimer);
+ return timeout_error;
+ }
+