[rtems commit] posix: nanosleep: optimize away a time conversion

Gedare Bloom gedare at rtems.org
Fri Jul 29 17:14:39 UTC 2016


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

Author:    Gedare Bloom <gedare at rtems.org>
Date:      Fri Jul 29 13:13:41 2016 -0400

posix: nanosleep: optimize away a time conversion

updates #2732

---

 cpukit/posix/src/nanosleep.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/cpukit/posix/src/nanosleep.c b/cpukit/posix/src/nanosleep.c
index 779dc20..05d559a 100644
--- a/cpukit/posix/src/nanosleep.c
+++ b/cpukit/posix/src/nanosleep.c
@@ -201,8 +201,7 @@ int clock_nanosleep(
     err = clock_gettime( CLOCK_REALTIME, &now );
     if ( err != 0 )
       return EINVAL;
-    _Timespec_From_ticks( relative_interval, &relative_ts );
-    _Timespec_Add_to( &now, &relative_ts );
+    _Timespec_Add_to( &now, rqtp );
     ticks = _Watchdog_Ticks_from_timespec( &now );
     err = nanosleep_helper( ticks, relative_interval, rmtp, WATCHDOG_ABSOLUTE );
   } else if ( clock_id == CLOCK_MONOTONIC ) {




More information about the vc mailing list