htl: Check error returned by __getrlimit
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Mon, 2 Jan 2023 00:01:28 +0000 (01:01 +0100)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Mon, 2 Jan 2023 10:36:10 +0000 (11:36 +0100)
htl/pt-create.c

index 5d37edbbffb16b7cbb6db133016653227fc45f47..d3847b69ea3c1791d76a0fbafd23c24a51e713db 100644 (file)
@@ -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;