diff mbox series

[hurd,commited,1/7] htl: Check error returned by __getrlimit

Message ID 20230102100938.2778311-2-samuel.thibault@ens-lyon.org
State New
Headers show
Series hurd: fixes | expand

Commit Message

Samuel Thibault Jan. 2, 2023, 10:09 a.m. UTC
---
 htl/pt-create.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

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;