summaryrefslogtreecommitdiffstats
path: root/lib/libc_r/uthread/uthread_detach.c
diff options
context:
space:
mode:
authoralex <alex@FreeBSD.org>1997-11-25 01:29:16 +0000
committeralex <alex@FreeBSD.org>1997-11-25 01:29:16 +0000
commit2d792e656e2819795c575a1abeb8dc54e2357484 (patch)
treeafcf53c94eef7b38ab83072ef9f8a80651b0230d /lib/libc_r/uthread/uthread_detach.c
parent674aa81547dfa76c24a1a45b5acb9119cab75311 (diff)
downloadFreeBSD-src-2d792e656e2819795c575a1abeb8dc54e2357484.zip
FreeBSD-src-2d792e656e2819795c575a1abeb8dc54e2357484.tar.gz
Modify the return values to comply with POSIX. Previously these
functions would return -1 and set errno to indicate the specific error. POSIX requires that the functions return the error code as the return value of the function instead.
Diffstat (limited to 'lib/libc_r/uthread/uthread_detach.c')
-rw-r--r--lib/libc_r/uthread/uthread_detach.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/libc_r/uthread/uthread_detach.c b/lib/libc_r/uthread/uthread_detach.c
index 08cace4..c8f312c 100644
--- a/lib/libc_r/uthread/uthread_detach.c
+++ b/lib/libc_r/uthread/uthread_detach.c
@@ -49,8 +49,7 @@ pthread_detach(pthread_t * p_pthread)
/* Check for invalid calling parameters: */
if (p_pthread == NULL || (pthread = *p_pthread) == NULL) {
/* Return an invalid argument error: */
- errno = EINVAL;
- rval = -1;
+ rval = EINVAL;
}
/* Check if the thread has not been detached: */
else if ((pthread->attr.flags & PTHREAD_DETACHED) == 0) {
@@ -70,8 +69,7 @@ pthread_detach(pthread_t * p_pthread)
*p_pthread = NULL;
} else {
/* Return an error: */
- errno = ESRCH;
- rval = -1;
+ rval = ESRCH;
}
/* Unblock signals: */
OpenPOWER on IntegriCloud