summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/uthread/uthread_attr_setscope.c
diff options
context:
space:
mode:
authorfgsch <fgsch@openbsd.org>2002-02-19 01:13:08 +0000
committerfgsch <fgsch@openbsd.org>2002-02-19 01:13:08 +0000
commit60575c75f78c49b512e2c93fd7da4bb2cba44eba (patch)
tree6febae19f8c8f4763b0596492310f3185d6adc5a /lib/libpthread/uthread/uthread_attr_setscope.c
parentFrom FreeBSD: (diff)
downloadwireguard-openbsd-60575c75f78c49b512e2c93fd7da4bb2cba44eba.tar.xz
wireguard-openbsd-60575c75f78c49b512e2c93fd7da4bb2cba44eba.zip
correct return values.
Diffstat (limited to 'lib/libpthread/uthread/uthread_attr_setscope.c')
-rw-r--r--lib/libpthread/uthread/uthread_attr_setscope.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/libpthread/uthread/uthread_attr_setscope.c b/lib/libpthread/uthread/uthread_attr_setscope.c
index 1f6ccac2f7a..2b8f4122034 100644
--- a/lib/libpthread/uthread/uthread_attr_setscope.c
+++ b/lib/libpthread/uthread/uthread_attr_setscope.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_attr_setscope.c,v 1.3 2002/01/19 23:49:32 fgsch Exp $ */
+/* $OpenBSD: uthread_attr_setscope.c,v 1.4 2002/02/19 01:13:08 fgsch Exp $ */
/*
* Copyright (c) 1998 Daniel Eischen <eischen@vigrid.com>.
* All rights reserved.
@@ -42,16 +42,14 @@ pthread_attr_setscope(pthread_attr_t *attr, int contentionscope)
{
int ret = 0;
- if ((attr == NULL) || (*attr == NULL) ||
- (contentionscope != PTHREAD_SCOPE_PROCESS) ||
- (contentionscope != PTHREAD_SCOPE_SYSTEM))
+ if ((attr == NULL) || (*attr == NULL)) {
/* Return an invalid argument: */
ret = EINVAL;
-
- else if (contentionscope == PTHREAD_SCOPE_SYSTEM)
- /* We don't support system wide contention: */
+ } else if ((contentionscope != PTHREAD_SCOPE_PROCESS) ||
+ (contentionscope == PTHREAD_SCOPE_SYSTEM)) {
+ /* We don't support PTHREAD_SCOPE_SYSTEM. */
ret = ENOTSUP;
- else
+ } else
(*attr)->flags |= contentionscope;
return(ret);