From e8ee2f324c3d88b304a0139ee2837823d87a656a Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Sun, 5 Oct 1997 16:26:04 +0000 Subject: [PATCH] If the specified time period is less than a clock tick, then it is arbitrarily assumed to be 1 clock tick. --- c/src/exec/posix/src/time.c | 5 ++++- cpukit/posix/src/time.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/c/src/exec/posix/src/time.c b/c/src/exec/posix/src/time.c index acb4b507b1..a14eb71f8e 100644 --- a/c/src/exec/posix/src/time.c +++ b/c/src/exec/posix/src/time.c @@ -62,7 +62,10 @@ Watchdog_Interval _POSIX_Timespec_to_interval( ticks += (time->tv_nsec / TOD_NANOSECONDS_PER_MICROSECOND) / _TOD_Microseconds_per_tick; - return ticks; + if (ticks) + return ticks; + + return 1; } /*PAGE diff --git a/cpukit/posix/src/time.c b/cpukit/posix/src/time.c index acb4b507b1..a14eb71f8e 100644 --- a/cpukit/posix/src/time.c +++ b/cpukit/posix/src/time.c @@ -62,7 +62,10 @@ Watchdog_Interval _POSIX_Timespec_to_interval( ticks += (time->tv_nsec / TOD_NANOSECONDS_PER_MICROSECOND) / _TOD_Microseconds_per_tick; - return ticks; + if (ticks) + return ticks; + + return 1; } /*PAGE