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

Joel Sherrill joel at rtems.org
Mon May 17 15:05:46 UTC 2021


Looks ok

On Mon, May 17, 2021 at 10:01 AM Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:

> 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
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20210517/1ab2e4ec/attachment-0001.html>


More information about the devel mailing list