about summary refs log tree commit diff
path: root/nptl
diff options
context:
space:
mode:
Diffstat (limited to 'nptl')
-rw-r--r--nptl/Banner2
-rw-r--r--nptl/ChangeLog4
-rw-r--r--nptl/pthread_condattr_setpshared.c9
3 files changed, 12 insertions, 3 deletions
diff --git a/nptl/Banner b/nptl/Banner
index 1c418c1698..be11d5b816 100644
--- a/nptl/Banner
+++ b/nptl/Banner
@@ -1 +1 @@
-NPTL 0.56 by Ulrich Drepper
+NPTL 0.57 by Ulrich Drepper
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index a92ac5ad67..95c458bee6 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,5 +1,9 @@
 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
 
+	* pthread_condattr_setpshared.c: Include errno.h.
+	(pthread_condattr_setpshared): Return EINVAL if pshared
+	is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
+
 	* sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
 	defined symbol for entry point to avoid cancellation.
 	* sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
diff --git a/nptl/pthread_condattr_setpshared.c b/nptl/pthread_condattr_setpshared.c
index f47afccef0..f00858780b 100644
--- a/nptl/pthread_condattr_setpshared.c
+++ b/nptl/pthread_condattr_setpshared.c
@@ -17,16 +17,21 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include "pthreadP.h"
+#include <errno.h>
+#include <pthreadP.h>
 
 int
 pthread_condattr_setpshared (attr, pshared)
      pthread_condattr_t *attr;
      int pshared;
 {
+  if (pshared != PTHREAD_PROCESS_PRIVATE
+      && __builtin_expect (pshared != PTHREAD_PROCESS_SHARED, 0))
+    return EINVAL;
+
   int *valuep = &((struct pthread_condattr *) attr)->value;
 
-  *valuep = (*valuep & ~1) | (pshared != 0);
+  *valuep = (*valuep & ~1) | (pshared != PTHREAD_PROCESS_PRIVATE);
 
   return 0;
 }