mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-11-16 12:34:45 +00:00
posix: Fix return status of pthread_cancel()
POSIX recommends ESRCH in case no thread exists for the specified identifier. Update #2713.
This commit is contained in:
@@ -64,5 +64,5 @@ int pthread_cancel(
|
||||
break;
|
||||
}
|
||||
|
||||
return EINVAL;
|
||||
return ESRCH;
|
||||
}
|
||||
|
||||
@@ -101,9 +101,9 @@ void *countTaskAsync(void *ignored)
|
||||
sc = pthread_setcanceltype(12, &old);
|
||||
fatal_posix_service_status( sc, EINVAL, "cancel type EINVAL" );
|
||||
|
||||
puts( "Init - pthread_cancel - bad ID - EINVAL" );
|
||||
puts( "Init - pthread_cancel - bad ID - ESRCH" );
|
||||
sc = pthread_cancel(0x100);
|
||||
fatal_posix_service_status( sc, EINVAL, "cancel bad Id" );
|
||||
fatal_posix_service_status( sc, ESRCH, "cancel bad Id" );
|
||||
|
||||
/* Start countTask deferred */
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user