From c51edb3fae21f8e7ca945236092a23f6891bae0f Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 24 Apr 2012 01:38:45 -0400 Subject: 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 --- libpthread/linuxthreads.old/manager.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'libpthread/linuxthreads.old/manager.c') 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 */ -- cgit v1.2.3