diff options
Diffstat (limited to 'cpukit/score/src/coretodabsolutetimeout.c')
-rw-r--r-- | cpukit/score/src/coretodabsolutetimeout.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cpukit/score/src/coretodabsolutetimeout.c b/cpukit/score/src/coretodabsolutetimeout.c index 6c9ffc22d5..fe74a6bbf2 100644 --- a/cpukit/score/src/coretodabsolutetimeout.c +++ b/cpukit/score/src/coretodabsolutetimeout.c @@ -25,13 +25,13 @@ */ TOD_Absolute_timeout_conversion_results _TOD_Absolute_timeout_to_ticks( const struct timespec *abstime, + clockid_t clock, Watchdog_Interval *ticks_out ) { struct timespec current_time; struct timespec difference; - /* * Make sure there is always a value returned. */ @@ -46,7 +46,12 @@ TOD_Absolute_timeout_conversion_results _TOD_Absolute_timeout_to_ticks( /* * Is the absolute time in the past? */ - _TOD_Get_as_timespec( ¤t_time ); + if ( clock == CLOCK_REALTIME ) { + _TOD_Get_as_timespec( ¤t_time ); + } else { + _Assert( clock == CLOCK_MONOTONIC ); + _TOD_Get_zero_based_uptime_as_timespec( ¤t_time ); + } if ( _Timespec_Less_than( abstime, ¤t_time ) ) return TOD_ABSOLUTE_TIMEOUT_IS_IN_PAST; |