diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2002-02-19 01:13:09 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2002-02-19 01:13:09 +0000 |
commit | 6bd4b2db7fe33a986bb25dcc3b7cd9b9962b3e7a (patch) | |
tree | a709b1efd06da44e529ec37a90f4e2e52942b66f | |
parent | 99f0cfd0a7b4d70d7504fce7cb365b0e889a4bb7 (diff) |
correct return values.
-rw-r--r-- | lib/libc_r/uthread/uthread_attr_setscope.c | 14 | ||||
-rw-r--r-- | lib/libpthread/uthread/uthread_attr_setscope.c | 14 |
2 files changed, 12 insertions, 16 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); 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); |