diff options
Diffstat (limited to 'cpukit/posix')
-rw-r--r-- | cpukit/posix/ChangeLog | 5 | ||||
-rw-r--r-- | cpukit/posix/src/ptimer1.c | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/cpukit/posix/ChangeLog b/cpukit/posix/ChangeLog index daeb344d9d..25c21bb555 100644 --- a/cpukit/posix/ChangeLog +++ b/cpukit/posix/ChangeLog @@ -1,3 +1,8 @@ +2003-01-27 Juan Zamorano <jzamora@fi.upm.es> + + * src/ptimer1.c: Correct problem which could lead to overflow in time + math. + 2003-01-03 Joel Sherrill <joel@OARcorp.com> * ChangeLog: Corrected entry for sysconf.c which did not include PR. diff --git a/cpukit/posix/src/ptimer1.c b/cpukit/posix/src/ptimer1.c index 907645ce18..ddb7d5c66a 100644 --- a/cpukit/posix/src/ptimer1.c +++ b/cpukit/posix/src/ptimer1.c @@ -175,8 +175,8 @@ void ITIMERSPEC_TO_RTEMS_TIME_OF_DAY_S rtems_time->second = seconds; - rtems_time->ticks = ( itimer->it_value.tv_nsec * SEC_TO_TICKS_C ) / - NSEC_PER_SEC_C; + rtems_time->ticks = itimer->it_value.tv_nsec/ + (NSEC_PER_SEC_C / SEC_TO_TICKS_C); } @@ -573,8 +573,7 @@ int timer_settime( timer_struct[timer_pos].ticks = ( SEC_TO_TICKS_C * value->it_value.tv_sec ) + - ( value->it_value.tv_nsec / - (1000L * (unsigned32)(1000 * 10) )); + ( value->it_value.tv_nsec / (NSEC_PER_SEC_C / SEC_TO_TICKS_C)); return_v = rtems_timer_fire_after ( timerid, timer_struct[timer_pos].ticks, |