about summary refs log tree commit diff
path: root/nptl
diff options
context:
space:
mode:
Diffstat (limited to 'nptl')
-rw-r--r--nptl/ChangeLog5
-rw-r--r--nptl/allocatestack.c11
2 files changed, 9 insertions, 7 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index b29f3b30f5..43dfc3b63c 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,8 @@
+2004-03-26  Ulrich Drepper  <drepper@redhat.com>
+
+	* allocatestack.c (_make_stacks_executable): Call
+	_dl_make_stack_executable first.
+
 2004-03-24  Roland McGrath  <roland@redhat.com>
 
 	* sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index 7983bed273..4b5af82f06 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -676,9 +676,10 @@ int
 internal_function
 __make_stacks_executable (void **stack_endp)
 {
-  /* Challenge the caller.  */
-  if (*stack_endp != __libc_stack_end)
-    return EPERM;
+  /* First the main thread's stack.  */
+  int err = _dl_make_stack_executable (stack_endp);
+  if (err != 0)
+    return err;
 
 #ifdef NEED_SEPARATE_REGISTER_STACK
   const size_t pagemask = ~(__getpagesize () - 1);
@@ -686,7 +687,6 @@ __make_stacks_executable (void **stack_endp)
 
   lll_lock (stack_cache_lock);
 
-  int err = 0;
   list_t *runp;
   list_for_each (runp, &stack_used)
     {
@@ -716,9 +716,6 @@ __make_stacks_executable (void **stack_endp)
 
   lll_unlock (stack_cache_lock);
 
-  if (err == 0)
-    err = _dl_make_stack_executable (stack_endp);
-
   return err;
 }