[git commit] linuxthreads.old: refactor nommu logic a little to avoid mmu warning

Mike Frysinger vapier at gentoo.org
Tue Apr 24 05:39:15 UTC 2012


commit: http://git.uclibc.org/uClibc/commit/?id=c51edb3fae21f8e7ca945236092a23f6891bae0f
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

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 at gentoo.org>
---
 libpthread/linuxthreads.old/manager.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/libpthread/linuxthreads.old/manager.c b/libpthread/linuxthreads.old/manager.c
index 1cae6e4..2a3bc26 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 */


More information about the uClibc-cvs mailing list