[glibc] htl: Check error returned by __getrlimit
Samuel Thibault
sthibaul@sourceware.org
Mon Jan 2 10:36:16 GMT 2023
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3a614f39e61140dd2478ce5b7564ec8a53269ea4
commit 3a614f39e61140dd2478ce5b7564ec8a53269ea4
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Mon Jan 2 01:01:28 2023 +0100
htl: Check error returned by __getrlimit
Diff:
---
htl/pt-create.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/htl/pt-create.c b/htl/pt-create.c
index 5d37edbbff..d3847b69ea 100644
--- a/htl/pt-create.c
+++ b/htl/pt-create.c
@@ -136,8 +136,8 @@ __pthread_create_internal (struct __pthread **thread,
if (stacksize == 0)
{
struct rlimit rlim;
- __getrlimit (RLIMIT_STACK, &rlim);
- if (rlim.rlim_cur != RLIM_INFINITY)
+ err = __getrlimit (RLIMIT_STACK, &rlim);
+ if (err == 0 && rlim.rlim_cur != RLIM_INFINITY)
stacksize = rlim.rlim_cur;
if (stacksize == 0)
stacksize = PTHREAD_STACK_DEFAULT;
More information about the Glibc-cvs
mailing list