]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Use ALIGN_UP in nptl/nptl-init.c
authorCarlos O'Donell <carlos@redhat.com>
Sat, 29 Nov 2014 06:21:58 +0000 (01:21 -0500)
committerCarlos O'Donell <carlos@redhat.com>
Sat, 29 Nov 2014 06:21:58 +0000 (01:21 -0500)
Replace bespoke code to align a value with
the ALIGN_UP macro to make it easier to read.

ChangeLog
nptl/nptl-init.c

index 39e70e130c1f3a0e3d6990d033c318696961e4c0..5c49d7dc724e5d47df74d66e094e9b10fae25da9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2014-11-29  Carlos O'Donell  <carlos@redhat.com>
 
+       * nptl/nptl-init.c: Include libc-internal.h.
+       (__pthread_initialize_minimal_internal): Use ROUND_UP.
+
        * elf/ldconfig.c (search_dir): Expand comment.
 
 2014-11-29  Joseph Myers  <joseph@codesourcery.com>
index 831d762a7071229050d79e3eeb42449f46ba1cf9..dcb77c5cf61714c90f8bbf5e10ccf7a1877549c8 100644 (file)
@@ -35,7 +35,7 @@
 #include <smp.h>
 #include <lowlevellock.h>
 #include <kernel-features.h>
-
+#include <libc-internal.h>
 
 #ifndef TLS_MULTIPLE_THREADS_IN_TCB
 /* Pointer to the corresponding variable in libc.  */
@@ -451,7 +451,7 @@ __pthread_initialize_minimal_internal (void)
     limit.rlim_cur = minstack;
 
   /* Round the resource limit up to page size.  */
-  limit.rlim_cur = (limit.rlim_cur + pagesz - 1) & -pagesz;
+  limit.rlim_cur = ALIGN_UP (limit.rlim_cur, pagesz);
   lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
   __default_pthread_attr.stacksize = limit.rlim_cur;
   __default_pthread_attr.guardsize = GLRO (dl_pagesize);