summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_mattr_init.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/libpthread/thread/thr_mattr_init.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/libpthread/thread/thr_mattr_init.c')
-rw-r--r--lib/libpthread/thread/thr_mattr_init.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libpthread/thread/thr_mattr_init.c b/lib/libpthread/thread/thr_mattr_init.c
index 323c982..73226a6 100644
--- a/lib/libpthread/thread/thr_mattr_init.c
+++ b/lib/libpthread/thread/thr_mattr_init.c
@@ -45,8 +45,7 @@ pthread_mutexattr_init(pthread_mutexattr_t *attr)
if ((pattr = (pthread_mutexattr_t)
malloc(sizeof(struct pthread_mutex_attr))) == NULL) {
- errno = ENOMEM;
- ret = -1;
+ ret = ENOMEM;
} else {
memcpy(pattr, &pthread_mutexattr_default,
sizeof(struct pthread_mutex_attr));
OpenPOWER on IntegriCloud