Committer: Tim Just <tim.just@xxxxxxxxxxxxxx> Date: Thu Mar 11 17:08:04 2010 +0100 Revision: 3929 Revision-id: tim.just@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Branch nick: trunk Log: Fixed bug in calc_timeval_diff. HEARTBEAT statistics now work again. In the case a roundtrip time value is less than one second, only the microsecond value from struct timeval has to be higher for the endtime. Therefore use ">=" instead ">" when comparing the value of "tv_sec". Modified: M lib/core/hip_statistics.c === modified file 'lib/core/hip_statistics.c' --- lib/core/hip_statistics.c 2010-03-03 16:51:18 +0000 +++ lib/core/hip_statistics.c 2010-03-11 16:08:04 +0000 @@ -91,8 +91,8 @@ HIP_ASSERT(timeval_start != NULL); HIP_ASSERT(timeval_end != NULL); - // check that timeval_high really is higher - if ((timeval_end->tv_sec > timeval_start->tv_sec) && + /* check that timeval_high really is higher */ + if ((timeval_end->tv_sec >= timeval_start->tv_sec) && (timeval_end->tv_usec > timeval_start->tv_usec)) { rel_timeval.tv_sec = timeval_end->tv_sec - timeval_start->tv_sec;