diff options
author | 2002-02-19 01:13:08 +0000 | |
---|---|---|
committer | 2002-02-19 01:13:08 +0000 | |
commit | 60575c75f78c49b512e2c93fd7da4bb2cba44eba (patch) | |
tree | 6febae19f8c8f4763b0596492310f3185d6adc5a /lib/libc_r | |
parent | From FreeBSD: (diff) | |
download | wireguard-openbsd-60575c75f78c49b512e2c93fd7da4bb2cba44eba.tar.xz wireguard-openbsd-60575c75f78c49b512e2c93fd7da4bb2cba44eba.zip |
correct return values.
Diffstat (limited to 'lib/libc_r')
-rw-r--r-- | lib/libc_r/uthread/uthread_attr_setscope.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/libc_r/uthread/uthread_attr_setscope.c b/lib/libc_r/uthread/uthread_attr_setscope.c index 1f6ccac2f7a..2b8f4122034 100644 --- a/lib/libc_r/uthread/uthread_attr_setscope.c +++ b/lib/libc_r/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); |