diff options
| author | Bernard Xiong <[email protected]> | 2021-07-14 19:54:39 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-07-14 19:54:39 +0800 |
| commit | 66cc36c70a117edc991558a80087a6d545f50fbe (patch) | |
| tree | eaf3c41986bdc18ed574acc239cfdb3b3c612d16 /components | |
| parent | 4919c415273d2b95a0e2a994bb081cad78969d22 (diff) | |
| parent | b277135f06c8a62d0447dac06ee08cd3d11fc3ac (diff) | |
Merge pull request #4861 from CornerOfSkyline/fix_pthread_sem_init_err
Fix the sem init check bug in pthread.
Diffstat (limited to 'components')
| -rw-r--r-- | components/libc/pthreads/semaphore.c | 2 |
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); |
