From 3a614f39e61140dd2478ce5b7564ec8a53269ea4 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 2 Jan 2023 01:01:28 +0100 Subject: [PATCH] htl: Check error returned by __getrlimit --- 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;