Skip to content

Commit b277135

Browse files
Fix the sem init check bug in pthread.
1 parent f8cf834 commit b277135

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/libc/pthreads/semaphore.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ int sem_init(sem_t *sem, int pshared, unsigned int value)
186186

187187
rt_snprintf(name, sizeof(name), "psem%02d", psem_number++);
188188
sem->sem = rt_sem_create(name, value, RT_IPC_FLAG_FIFO);
189-
if (sem == RT_NULL)
189+
if (sem->sem == RT_NULL)
190190
{
191191
rt_set_errno(ENOMEM);
192192

0 commit comments

Comments
 (0)