Hi,

POSIX mandates that we return EINVAL if count equals zero on barrier
initialization. Which makes sense to me.

This also fixes posixtestsuite conformance 3-1 test.

OK?


Index: rthread_barrier.c
===================================================================
RCS file: /cvs/src/lib/librthread/rthread_barrier.c,v
retrieving revision 1.3
diff -u -p -u -p -r1.3 rthread_barrier.c
--- rthread_barrier.c   15 Apr 2016 17:54:17 -0000      1.3
+++ rthread_barrier.c   5 Jul 2018 10:16:44 -0000
@@ -31,6 +31,9 @@ pthread_barrier_init(pthread_barrier_t *
        if (barrier == NULL)
                return (EINVAL);
 
+       if (count == 0)
+               return(EINVAL);
+
        if (attr != NULL) {
                if (*attr == NULL)
                        return (EINVAL);

Reply via email to