sem_open: return error code, sem returned by parameter

pointer comparison is unsigned, when returning -errno will be converted
to a large positive number, can not enter the error handling branch,
therefore, the error code is returned directly and the sem is returned
through the parameters.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu
2024-06-05 10:25:08 +08:00
committed by Xiang Xiao
parent 96f83bb03a
commit ee4c25f34e
5 changed files with 18 additions and 16 deletions
+1 -1
View File
@@ -84,7 +84,7 @@
"nxsem_clockwait","nuttx/semaphore.h","","int","FAR sem_t *","clockid_t","FAR const struct timespec *"
"nxsem_close","nuttx/semaphore.h","defined(CONFIG_FS_NAMED_SEMAPHORES)","int","FAR sem_t *"
"nxsem_destroy","nuttx/semaphore.h","","int","FAR sem_t *"
"nxsem_open","nuttx/semaphore.h","defined(CONFIG_FS_NAMED_SEMAPHORES)","FAR sem_t *","FAR const char *","int","...","mode_t","unsigned int"
"nxsem_open","nuttx/semaphore.h","defined(CONFIG_FS_NAMED_SEMAPHORES)","int","FAR sem_t **","FAR const char *","int","...","mode_t","unsigned int"
"nxsem_post","nuttx/semaphore.h","","int","FAR sem_t *"
"nxsem_set_protocol","nuttx/semaphore.h","defined(CONFIG_PRIORITY_INHERITANCE)","int","FAR sem_t *","int"
"nxsem_timedwait","nuttx/semaphore.h","","int","FAR sem_t *","FAR const struct timespec *"
1 _assert assert.h void FAR const char * int FAR const char * FAR void *
84 nxsem_clockwait nuttx/semaphore.h int FAR sem_t * clockid_t FAR const struct timespec *
85 nxsem_close nuttx/semaphore.h defined(CONFIG_FS_NAMED_SEMAPHORES) int FAR sem_t *
86 nxsem_destroy nuttx/semaphore.h int FAR sem_t *
87 nxsem_open nuttx/semaphore.h defined(CONFIG_FS_NAMED_SEMAPHORES) FAR sem_t * int FAR const char * FAR sem_t ** int FAR const char * ... int mode_t ...
88 nxsem_post nuttx/semaphore.h int FAR sem_t *
89 nxsem_set_protocol nuttx/semaphore.h defined(CONFIG_PRIORITY_INHERITANCE) int FAR sem_t * int
90 nxsem_timedwait nuttx/semaphore.h int FAR sem_t * FAR const struct timespec *