Ver Fonte

[components/libc/posix]fix the errors that assigning an integer to a pointer and always return EINVAL.

ligr há 8 meses atrás
pai
commit
0bac8c4f90
1 ficheiros alterados com 4 adições e 1 exclusões
  1. 4 1
      components/libc/posix/pthreads/pthread_barrier.c

+ 4 - 1
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;
 }