From 0bac8c4f90ebefc16decc8b1c4e96c9802a79a9c Mon Sep 17 00:00:00 2001 From: ligr Date: Thu, 21 Nov 2024 10:54:52 +0800 Subject: [PATCH] [components/libc/posix]fix the errors that assigning an integer to a pointer and always return EINVAL. --- components/libc/posix/pthreads/pthread_barrier.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/libc/posix/pthreads/pthread_barrier.c b/components/libc/posix/pthreads/pthread_barrier.c index 823a2158e0..f2c0e2d1c3 100644 --- a/components/libc/posix/pthreads/pthread_barrier.c +++ b/components/libc/posix/pthreads/pthread_barrier.c @@ -45,7 +45,10 @@ int pthread_barrierattr_setpshared(pthread_barrierattr_t *attr, int pshared) if (!attr) return EINVAL; if (pshared == PTHREAD_PROCESS_PRIVATE) - attr = PTHREAD_PROCESS_PRIVATE; + { + *attr = PTHREAD_PROCESS_PRIVATE; + return 0; + } return EINVAL; }