summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/alarm.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/posix/src/alarm.c')
-rw-r--r--cpukit/posix/src/alarm.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/cpukit/posix/src/alarm.c b/cpukit/posix/src/alarm.c
index c061b97e48..71097554c7 100644
--- a/cpukit/posix/src/alarm.c
+++ b/cpukit/posix/src/alarm.c
@@ -69,9 +69,12 @@ unsigned int alarm(
* this.
*/
- remaining = the_timer->initial -
- ((the_timer->stop_time - the_timer->start_time) /
- _TOD_Ticks_per_second);
+ remaining = the_timer->initial;
+ remaining -= (the_timer->stop_time - the_timer->start_time);
+
+ /* remaining is now in ticks */
+ remaining *= _TOD_Microseconds_per_tick;
+ remaining /= TOD_MICROSECONDS_PER_SECOND;
break;
}
}