[PATCH 2/2] posix: Use RTEMS_POSIX_API in clock_nanosleep()

Sebastian Huber sebastian.huber at embedded-brains.de
Mon May 17 15:01:34 UTC 2021


It is only possible to get interrupted by a POSIX signal if
RTEMS_POSIX_API is defined.
---
 cpukit/posix/src/clocknanosleep.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/cpukit/posix/src/clocknanosleep.c b/cpukit/posix/src/clocknanosleep.c
index 73b7d9c6a1..951268bc1f 100644
--- a/cpukit/posix/src/clocknanosleep.c
+++ b/cpukit/posix/src/clocknanosleep.c
@@ -97,6 +97,7 @@ int clock_nanosleep(
   }
 
   if ( rmtp != NULL && ( flags & TIMER_ABSTIME ) == 0 ) {
+#if defined( RTEMS_POSIX_API )
     if ( eno == EINTR ) {
       struct timespec actual_end;
 
@@ -110,6 +111,10 @@ int clock_nanosleep(
     } else {
       _Timespec_Set_to_zero( rmtp );
     }
+#else
+    _Assert( eno != EINTR );
+    _Timespec_Set_to_zero( rmtp );
+#endif
   }
 
   return eno;
-- 
2.26.2



More information about the devel mailing list