summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2001-08-10 14:37:21 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2001-08-10 14:37:21 +0000
commite74d8b0e63cc105424cabde08fe5f128e82ff1ca (patch)
tree0167b546e7b01accf441f51ee7538e059f1e5bf6
parent2a1ce14bf84160e4d843fe59733cfa3f7ae1ae25 (diff)
pthread_* do not set errno but returns a errno value.
-rw-r--r--lib/libc_r/uthread/uthread_attr_setcreatesuspend_np.c5
-rw-r--r--lib/libc_r/uthread/uthread_attr_setprio.c5
-rw-r--r--lib/libc_r/uthread/uthread_mattr_kind_np.c11
-rw-r--r--lib/libpthread/uthread/uthread_attr_setcreatesuspend_np.c5
-rw-r--r--lib/libpthread/uthread/uthread_attr_setprio.c5
-rw-r--r--lib/libpthread/uthread/uthread_mattr_kind_np.c11
6 files changed, 16 insertions, 26 deletions
diff --git a/lib/libc_r/uthread/uthread_attr_setcreatesuspend_np.c b/lib/libc_r/uthread/uthread_attr_setcreatesuspend_np.c
index 64c30da907e..e1d7d51bfaa 100644
--- a/lib/libc_r/uthread/uthread_attr_setcreatesuspend_np.c
+++ b/lib/libc_r/uthread/uthread_attr_setcreatesuspend_np.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_attr_setcreatesuspend_np.c,v 1.3 1999/11/25 07:01:31 d Exp $ */
+/* $OpenBSD: uthread_attr_setcreatesuspend_np.c,v 1.4 2001/08/10 14:37:20 fgsch Exp $ */
/*
* Copyright (c) 1995 John Birrell <jb@cimlogic.com.au>.
* All rights reserved.
@@ -42,8 +42,7 @@ pthread_attr_setcreatesuspend_np(pthread_attr_t *attr)
{
int ret;
if (attr == NULL || *attr == NULL) {
- errno = EINVAL;
- ret = -1;
+ ret = EINVAL;
} else {
(*attr)->suspend = PTHREAD_CREATE_SUSPENDED;
ret = 0;
diff --git a/lib/libc_r/uthread/uthread_attr_setprio.c b/lib/libc_r/uthread/uthread_attr_setprio.c
index f36e07208c6..f609560d2ab 100644
--- a/lib/libc_r/uthread/uthread_attr_setprio.c
+++ b/lib/libc_r/uthread/uthread_attr_setprio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_attr_setprio.c,v 1.3 1999/11/25 07:01:32 d Exp $ */
+/* $OpenBSD: uthread_attr_setprio.c,v 1.4 2001/08/10 14:37:20 fgsch Exp $ */
/*
* Copyright (c) 1996 John Birrell <jb@cimlogic.com.au>.
* All rights reserved.
@@ -41,8 +41,7 @@ int pthread_attr_setprio(pthread_attr_t *attr, int priority)
{
int ret;
if (attr == NULL || *attr == NULL) {
- errno = EINVAL;
- ret = -1;
+ ret = EINVAL;
} else {
(*attr)->prio = priority;
ret = 0;
diff --git a/lib/libc_r/uthread/uthread_mattr_kind_np.c b/lib/libc_r/uthread/uthread_mattr_kind_np.c
index 732c8682bbf..ddc9bee01fe 100644
--- a/lib/libc_r/uthread/uthread_mattr_kind_np.c
+++ b/lib/libc_r/uthread/uthread_mattr_kind_np.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_mattr_kind_np.c,v 1.6 2001/08/09 08:50:54 fgsch Exp $ */
+/* $OpenBSD: uthread_mattr_kind_np.c,v 1.7 2001/08/10 14:37:20 fgsch Exp $ */
/*
* Copyright (c) 1996 Jeffrey Hsu <hsu@freebsd.org>.
* All rights reserved.
@@ -42,8 +42,7 @@ pthread_mutexattr_setkind_np(pthread_mutexattr_t *attr, int kind)
{
int ret;
if (attr == NULL || *attr == NULL) {
- errno = EINVAL;
- ret = -1;
+ ret = EINVAL;
} else {
(*attr)->m_type = kind;
ret = 0;
@@ -56,8 +55,7 @@ pthread_mutexattr_getkind_np(pthread_mutexattr_t attr)
{
int ret;
if (attr == NULL) {
- errno = EINVAL;
- ret = -1;
+ ret = EINVAL;
} else {
ret = attr->m_type;
}
@@ -69,8 +67,7 @@ pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type)
{
int ret;
if (attr == NULL || *attr == NULL || type >= MUTEX_TYPE_MAX) {
- errno = EINVAL;
- ret = -1;
+ ret = EINVAL;
} else {
(*attr)->m_type = type;
ret = 0;
diff --git a/lib/libpthread/uthread/uthread_attr_setcreatesuspend_np.c b/lib/libpthread/uthread/uthread_attr_setcreatesuspend_np.c
index 64c30da907e..e1d7d51bfaa 100644
--- a/lib/libpthread/uthread/uthread_attr_setcreatesuspend_np.c
+++ b/lib/libpthread/uthread/uthread_attr_setcreatesuspend_np.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_attr_setcreatesuspend_np.c,v 1.3 1999/11/25 07:01:31 d Exp $ */
+/* $OpenBSD: uthread_attr_setcreatesuspend_np.c,v 1.4 2001/08/10 14:37:20 fgsch Exp $ */
/*
* Copyright (c) 1995 John Birrell <jb@cimlogic.com.au>.
* All rights reserved.
@@ -42,8 +42,7 @@ pthread_attr_setcreatesuspend_np(pthread_attr_t *attr)
{
int ret;
if (attr == NULL || *attr == NULL) {
- errno = EINVAL;
- ret = -1;
+ ret = EINVAL;
} else {
(*attr)->suspend = PTHREAD_CREATE_SUSPENDED;
ret = 0;
diff --git a/lib/libpthread/uthread/uthread_attr_setprio.c b/lib/libpthread/uthread/uthread_attr_setprio.c
index f36e07208c6..f609560d2ab 100644
--- a/lib/libpthread/uthread/uthread_attr_setprio.c
+++ b/lib/libpthread/uthread/uthread_attr_setprio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_attr_setprio.c,v 1.3 1999/11/25 07:01:32 d Exp $ */
+/* $OpenBSD: uthread_attr_setprio.c,v 1.4 2001/08/10 14:37:20 fgsch Exp $ */
/*
* Copyright (c) 1996 John Birrell <jb@cimlogic.com.au>.
* All rights reserved.
@@ -41,8 +41,7 @@ int pthread_attr_setprio(pthread_attr_t *attr, int priority)
{
int ret;
if (attr == NULL || *attr == NULL) {
- errno = EINVAL;
- ret = -1;
+ ret = EINVAL;
} else {
(*attr)->prio = priority;
ret = 0;
diff --git a/lib/libpthread/uthread/uthread_mattr_kind_np.c b/lib/libpthread/uthread/uthread_mattr_kind_np.c
index 732c8682bbf..ddc9bee01fe 100644
--- a/lib/libpthread/uthread/uthread_mattr_kind_np.c
+++ b/lib/libpthread/uthread/uthread_mattr_kind_np.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_mattr_kind_np.c,v 1.6 2001/08/09 08:50:54 fgsch Exp $ */
+/* $OpenBSD: uthread_mattr_kind_np.c,v 1.7 2001/08/10 14:37:20 fgsch Exp $ */
/*
* Copyright (c) 1996 Jeffrey Hsu <hsu@freebsd.org>.
* All rights reserved.
@@ -42,8 +42,7 @@ pthread_mutexattr_setkind_np(pthread_mutexattr_t *attr, int kind)
{
int ret;
if (attr == NULL || *attr == NULL) {
- errno = EINVAL;
- ret = -1;
+ ret = EINVAL;
} else {
(*attr)->m_type = kind;
ret = 0;
@@ -56,8 +55,7 @@ pthread_mutexattr_getkind_np(pthread_mutexattr_t attr)
{
int ret;
if (attr == NULL) {
- errno = EINVAL;
- ret = -1;
+ ret = EINVAL;
} else {
ret = attr->m_type;
}
@@ -69,8 +67,7 @@ pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type)
{
int ret;
if (attr == NULL || *attr == NULL || type >= MUTEX_TYPE_MAX) {
- errno = EINVAL;
- ret = -1;
+ ret = EINVAL;
} else {
(*attr)->m_type = type;
ret = 0;