diff options
author | davidxu <davidxu@FreeBSD.org> | 2003-09-25 13:53:49 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2003-09-25 13:53:49 +0000 |
commit | 528c35bfb34c36997bec98a6dc6c1737373eb2df (patch) | |
tree | f03b3fcaa2e7f35995ffb3fa93f690c92c96d642 /lib | |
parent | 99f18c28fc44a76bd422f2499e16f75cf58f887f (diff) | |
download | FreeBSD-src-528c35bfb34c36997bec98a6dc6c1737373eb2df.zip FreeBSD-src-528c35bfb34c36997bec98a6dc6c1737373eb2df.tar.gz |
pthread API should return error code in return value not in errno.
Reviewed by: deischen
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libkse/thread/thr_attr_setcreatesuspend_np.c | 4 | ||||
-rw-r--r-- | lib/libpthread/thread/thr_attr_setcreatesuspend_np.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/libkse/thread/thr_attr_setcreatesuspend_np.c b/lib/libkse/thread/thr_attr_setcreatesuspend_np.c index 28f0546..d844d62 100644 --- a/lib/libkse/thread/thr_attr_setcreatesuspend_np.c +++ b/lib/libkse/thread/thr_attr_setcreatesuspend_np.c @@ -41,9 +41,9 @@ int _pthread_attr_setcreatesuspend_np(pthread_attr_t *attr) { int ret; + if (attr == NULL || *attr == NULL) { - errno = EINVAL; - ret = -1; + ret = EINVAL; } else { (*attr)->suspend = THR_CREATE_SUSPENDED; ret = 0; diff --git a/lib/libpthread/thread/thr_attr_setcreatesuspend_np.c b/lib/libpthread/thread/thr_attr_setcreatesuspend_np.c index 28f0546..d844d62 100644 --- a/lib/libpthread/thread/thr_attr_setcreatesuspend_np.c +++ b/lib/libpthread/thread/thr_attr_setcreatesuspend_np.c @@ -41,9 +41,9 @@ int _pthread_attr_setcreatesuspend_np(pthread_attr_t *attr) { int ret; + if (attr == NULL || *attr == NULL) { - errno = EINVAL; - ret = -1; + ret = EINVAL; } else { (*attr)->suspend = THR_CREATE_SUSPENDED; ret = 0; |