Merge pull request #4861 from CornerOfSkyline/fix_pthread_sem_init_err

Fix the sem init check bug in pthread.
This commit is contained in:
Bernard Xiong 2021-07-14 19:54:39 +08:00 committed by GitHub
commit 66cc36c70a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -186,7 +186,7 @@ int sem_init(sem_t *sem, int pshared, unsigned int value)
rt_snprintf(name, sizeof(name), "psem%02d", psem_number++); rt_snprintf(name, sizeof(name), "psem%02d", psem_number++);
sem->sem = rt_sem_create(name, value, RT_IPC_FLAG_FIFO); sem->sem = rt_sem_create(name, value, RT_IPC_FLAG_FIFO);
if (sem == RT_NULL) if (sem->sem == RT_NULL)
{ {
rt_set_errno(ENOMEM); rt_set_errno(ENOMEM);