[rtems commit] posix: Fix clock_gettime()

Sebastian Huber sebh at rtems.org
Fri May 29 13:04:25 UTC 2015


Module:    rtems
Branch:    master
Commit:    8f6a31459c8e57db79f14f8a80777136e006a1d3
Changeset: http://git.rtems.org/rtems/commit/?id=8f6a31459c8e57db79f14f8a80777136e006a1d3

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri May 29 15:03:02 2015 +0200

posix: Fix clock_gettime()

The _TOD_Get_zero_based_uptime_as_timespec() returns already the right
value.

---

 cpukit/posix/src/clockgettime.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/cpukit/posix/src/clockgettime.c b/cpukit/posix/src/clockgettime.c
index 83a35d7..b3adbc4 100644
--- a/cpukit/posix/src/clockgettime.c
+++ b/cpukit/posix/src/clockgettime.c
@@ -43,7 +43,6 @@ int clock_gettime(
 #ifdef CLOCK_MONOTONIC
   if ( clock_id == CLOCK_MONOTONIC ) {
     _TOD_Get_zero_based_uptime_as_timespec( tp );
-    --tp->tv_sec;
     return 0;
   }
 #endif
@@ -51,7 +50,6 @@ int clock_gettime(
 #ifdef _POSIX_CPUTIME
   if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) {
     _TOD_Get_zero_based_uptime_as_timespec( tp );
-    --tp->tv_sec;
     return 0;
   }
 #endif



More information about the vc mailing list