diff options
author | Siddhesh Poyarekar <siddhesh@redhat.com> | 2013-04-22 10:28:31 +0530 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@redhat.com> | 2013-04-22 10:28:31 +0530 |
commit | da1304bcc8d718f40e58d92726c0fbc7b0d0794d (patch) | |
tree | 872f3f44330b1ec4faa83e22bf356ad31ef14b73 /nptl/pthread_attr_setstack.c | |
parent | 2169712d9c140d1b011470393c64258b2db3a4cd (diff) | |
download | glibc-da1304bcc8d718f40e58d92726c0fbc7b0d0794d.tar glibc-da1304bcc8d718f40e58d92726c0fbc7b0d0794d.tar.gz glibc-da1304bcc8d718f40e58d92726c0fbc7b0d0794d.tar.bz2 glibc-da1304bcc8d718f40e58d92726c0fbc7b0d0794d.zip |
Consolidate pthread_attr value validation
Define inline functions that wrap around validation for each of the
pthread attributes to reduce duplication in code.
Diffstat (limited to 'nptl/pthread_attr_setstack.c')
-rw-r--r-- | nptl/pthread_attr_setstack.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/nptl/pthread_attr_setstack.c b/nptl/pthread_attr_setstack.c index 783cffe6a1..4bd314e66a 100644 --- a/nptl/pthread_attr_setstack.c +++ b/nptl/pthread_attr_setstack.c @@ -39,8 +39,9 @@ __pthread_attr_setstack (attr, stackaddr, stacksize) iattr = (struct pthread_attr *) attr; /* Catch invalid sizes. */ - if (stacksize < PTHREAD_STACK_MIN) - return EINVAL; + int ret = check_stacksize_attr (stacksize); + if (ret) + return ret; #ifdef EXTRA_PARAM_CHECKS EXTRA_PARAM_CHECKS; |