Skip to content

Commit bd35bb1

Browse files
committed
[components/libc/posix]fix the errors that assigning an integer to a pointer and always return EINVAL.
1 parent 58d4007 commit bd35bb1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

components/libc/posix/pthreads/pthread_barrier.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ int pthread_barrierattr_setpshared(pthread_barrierattr_t *attr, int pshared)
4545
if (!attr)
4646
return EINVAL;
4747
if (pshared == PTHREAD_PROCESS_PRIVATE)
48-
attr = PTHREAD_PROCESS_PRIVATE;
48+
{
49+
*attr = PTHREAD_PROCESS_PRIVATE;
50+
return 0;
51+
}
4952

5053
return EINVAL;
5154
}

0 commit comments

Comments
 (0)