summaryrefslogtreecommitdiff
path: root/components/libc
diff options
context:
space:
mode:
authorCornerOfSkyline <[email protected]>2021-07-09 11:51:48 +0800
committerCornerOfSkyline <[email protected]>2021-07-09 11:51:48 +0800
commitb277135f06c8a62d0447dac06ee08cd3d11fc3ac (patch)
tree844bedf77f43760d1823ef491a5a2fa93a900c0e /components/libc
parentf8cf8341af4c7fdd14efdbe125ff38657e4d83fd (diff)
Fix the sem init check bug in pthread.
Diffstat (limited to 'components/libc')
-rw-r--r--components/libc/pthreads/semaphore.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/components/libc/pthreads/semaphore.c b/components/libc/pthreads/semaphore.c
index 398cdf1f49..199b33bfe8 100644
--- a/components/libc/pthreads/semaphore.c
+++ b/components/libc/pthreads/semaphore.c
@@ -186,7 +186,7 @@ int sem_init(sem_t *sem, int pshared, unsigned int value)
rt_snprintf(name, sizeof(name), "psem%02d", psem_number++);
sem->sem = rt_sem_create(name, value, RT_IPC_FLAG_FIFO);
- if (sem == RT_NULL)
+ if (sem->sem == RT_NULL)
{
rt_set_errno(ENOMEM);