nasa / osal

The Core Flight System (cFS) Operating System Abstraction Layer (OSAL)
Apache License 2.0
556 stars 217 forks source link

Add check of sem_wait/rtems_semaphore_obtain in console loop #668

Open skliper opened 3 years ago

skliper commented 3 years ago

Is your feature request related to a problem? Please describe. Console loop could spin if the semaphore returns error.

Describe the solution you'd like Check for real errors (not just interrupted), and exit loop if needed.

Describe alternatives you've considered None.

Additional context Mentioned in #667

Requester Info Jacob Hageman - NASA/GSFC

skliper commented 3 years ago

Issue only applies to POSIX and RTEMS: https://github.com/nasa/osal/blob/d698a4d7ddc66826a4c7c287468b5f1aa6ca372f/src/os/posix/src/os-impl-console.c#L102-L107 https://github.com/nasa/osal/blob/d698a4d7ddc66826a4c7c287468b5f1aa6ca372f/src/os/rtems/src/os-impl-console.c#L126-L130

Already implemented in VxWorks: https://github.com/nasa/osal/blob/d698a4d7ddc66826a4c7c287468b5f1aa6ca372f/src/os/vxworks/src/os-impl-console.c#L110-L118