summaryrefslogtreecommitdiff
path: root/libpthread/linuxthreads.old/manager.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-04-24 01:38:45 -0400
committerMike Frysinger <vapier@gentoo.org>2012-04-24 01:39:15 -0400
commitc51edb3fae21f8e7ca945236092a23f6891bae0f (patch)
tree9fe4502d6471a06abca6abf475bdce9178888e78 /libpthread/linuxthreads.old/manager.c
parent84347a3c16ec98df40fbd9fa8e26531d7b4c5187 (diff)
linuxthreads.old: refactor nommu logic a little to avoid mmu warning
Should be no functional changes; just fixing: libpthread/linuxthreads.old/manager.c: In function 'pthread_free': libpthread/linuxthreads.old/manager.c:707:9: warning: variable 'h_bottom_save' set but not used [-Wunused-but-set-variable] Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'libpthread/linuxthreads.old/manager.c')
-rw-r--r--libpthread/linuxthreads.old/manager.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libpthread/linuxthreads.old/manager.c b/libpthread/linuxthreads.old/manager.c
index 1cae6e418..2a3bc26d7 100644
--- a/libpthread/linuxthreads.old/manager.c
+++ b/libpthread/linuxthreads.old/manager.c
@@ -704,12 +704,16 @@ static void pthread_free(pthread_descr th)
{
pthread_handle handle;
pthread_readlock_info *iter, *next;
+#ifndef __ARCH_USE_MMU__
char *h_bottom_save;
+#endif
/* Make the handle invalid */
handle = thread_handle(th->p_tid);
__pthread_lock(&handle->h_lock, NULL);
+#ifndef __ARCH_USE_MMU__
h_bottom_save = handle->h_bottom;
+#endif
handle->h_descr = NULL;
handle->h_bottom = (char *)(-1L);
__pthread_unlock(&handle->h_lock);
@@ -737,20 +741,18 @@ static void pthread_free(pthread_descr th)
/* If initial thread, nothing to free */
if (th == &__pthread_initial_thread) return;
-#ifdef __ARCH_USE_MMU__
if (!th->p_userstack)
{
+#ifdef __ARCH_USE_MMU__
/* Free the stack and thread descriptor area */
if (th->p_guardsize != 0)
munmap(th->p_guardaddr, th->p_guardsize);
munmap((caddr_t) ((char *)(th+1) - STACK_SIZE), STACK_SIZE);
- }
#else
- /* For non-MMU systems we always malloc the stack, so free it here. -StS */
- if (!th->p_userstack) {
+ /* For non-MMU systems we always malloc the stack, so free it here. -StS */
free(h_bottom_save);
- }
#endif /* __ARCH_USE_MMU__ */
+ }
}
/* Handle threads that have exited */