summaryrefslogtreecommitdiff
path: root/components/libc
diff options
context:
space:
mode:
authorligr <[email protected]>2024-11-21 10:54:52 +0800
committerMeco Man <[email protected]>2024-11-21 19:22:44 -0500
commit0bac8c4f90ebefc16decc8b1c4e96c9802a79a9c (patch)
tree73148736a3eb690702e93257a153b4127c165c9f /components/libc
parent79324c0b4c9be600f12bb9ad214f766779a9ae02 (diff)
[components/libc/posix]fix the errors that assigning an integer to a pointer and always return EINVAL.
Diffstat (limited to 'components/libc')
-rw-r--r--components/libc/posix/pthreads/pthread_barrier.c5
1 files changed, 4 insertions, 1 deletions
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;
}