libc/sched: Return EINVAL when type incorrect at task_setcanceltype
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_setcancelstate.html The pthread_setcancelstate() function may fail if: [EINVAL] The specified state is not PTHREAD_CANCEL_ENABLE or PTHREAD_CANCEL_DISABLE. The pthread_setcanceltype() function may fail if: [EINVAL] The specified type is not PTHREAD_CANCEL_DEFERRED or PTHREAD_CANCEL_ASYNCHRONOUS. Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
This commit is contained in:
parent
962dfaf651
commit
f132edbf35
|
@ -55,5 +55,5 @@ int task_setcanceltype(int type, FAR int *oldtype)
|
|||
|
||||
/* Check the requested cancellation type */
|
||||
|
||||
return (type == TASK_CANCEL_ASYNCHRONOUS) ? OK : ENOSYS;
|
||||
return (type == TASK_CANCEL_ASYNCHRONOUS) ? OK : EINVAL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue