Bug 30699

Summary: pthread_attr_setscope function fails unconditionally
Product: Base System Reporter: yuri
Component: miscAssignee: Jason Evans <jasone>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description yuri 2001-09-21 01:50:03 UTC
source file src/lib/lib_r/uthread/uthread_attr_setscope.c:
pthread_attr_setscope fails unconditionally for any value of contentionscope.

Fix: 

In
<<
        } else if ((contentionscope != PTHREAD_SCOPE_PROCESS) ||
            (contentionscope != PTHREAD_SCOPE_SYSTEM)
How-To-Repeat: --
Comment 1 Jason Evans freebsd_committer freebsd_triage 2001-12-17 20:43:06 UTC
Responsible Changed
From-To: freebsd-bugs->jasone

I'll look at this.
Comment 2 Maxim Konovalov 2002-02-13 19:22:02 UTC
The fix is obvious:

Index: uthread_attr_setscope.c
===================================================================
RCS file: /home/ncvs/src/lib/libc_r/uthread/uthread_attr_setscope.c,v
retrieving revision 1.6
diff -u -r1.6 uthread_attr_setscope.c
--- uthread_attr_setscope.c	10 Apr 2001 04:19:19 -0000	1.6
+++ uthread_attr_setscope.c	13 Feb 2002 19:06:33 -0000
@@ -46,7 +46,7 @@
 		/* Return an invalid argument: */
 		ret = EINVAL;
 	} else if ((contentionscope != PTHREAD_SCOPE_PROCESS) ||
-	    (contentionscope != PTHREAD_SCOPE_SYSTEM)) {
+	    (contentionscope == PTHREAD_SCOPE_SYSTEM)) {
 		/* We don't support PTHREAD_SCOPE_SYSTEM. */
 		ret = ENOTSUP;
 	} else

-- 
Maxim Konovalov, MAcomnet, Internet-Intranet Dept., system engineer
phone: +7 (095) 796-9079, mailto:maxim@macomnet.ru
Comment 3 Maxim Konovalov freebsd_committer freebsd_triage 2002-02-14 10:49:06 UTC
State Changed
From-To: open->closed

Duplicated with misc/27311.