[rtems commit] posix: Use right time format in adjtime()

Sebastian Huber sebh at rtems.org
Thu Oct 12 05:05:40 UTC 2017


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Oct 11 21:33:44 2017 +0200

posix: Use right time format in adjtime()

Update #2740.

---

 cpukit/posix/src/adjtime.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/cpukit/posix/src/adjtime.c b/cpukit/posix/src/adjtime.c
index 32d1992..5cdfd13 100644
--- a/cpukit/posix/src/adjtime.c
+++ b/cpukit/posix/src/adjtime.c
@@ -43,7 +43,7 @@ int adjtime(
   struct timeval       *olddelta
 )
 {
-  Timestamp_Control  delta_as_timestamp;
+  struct timespec delta_as_timespec;
 
   /*
    * Simple validations
@@ -75,14 +75,15 @@ int adjtime(
   }
 
   /*
-   * convert delta timeval to internal timestamp
+   * convert delta timeval to timespec
    */
-  _Timestamp_Set( &delta_as_timestamp, delta->tv_sec, delta->tv_usec * 1000 );
+  delta_as_timespec.tv_sec = delta->tv_sec;
+  delta_as_timespec.tv_nsec = delta->tv_usec * 1000;
 
   /*
    * Now apply the adjustment
    */
-  _TOD_Adjust( &delta_as_timestamp );
+  _TOD_Adjust( &delta_as_timespec );
 
   return 0;
 }



More information about the vc mailing list