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_setstacksize.c | |
parent | 2169712d9c140d1b011470393c64258b2db3a4cd (diff) | |
download | glibc-da1304bcc8d718f40e58d92726c0fbc7b0d0794d.tar.gz glibc-da1304bcc8d718f40e58d92726c0fbc7b0d0794d.tar.xz 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_setstacksize.c')
-rw-r--r-- | nptl/pthread_attr_setstacksize.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/nptl/pthread_attr_setstacksize.c b/nptl/pthread_attr_setstacksize.c index b7f291906f..585bf087df 100644 --- a/nptl/pthread_attr_setstacksize.c +++ b/nptl/pthread_attr_setstacksize.c @@ -37,8 +37,9 @@ __pthread_attr_setstacksize (attr, 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; iattr->stacksize = stacksize; |