[git commit future 1/1] pthreadP.h: avoid shadow warnings

Khem Raj raj.khem at gmail.com
Sat Mar 19 18:51:25 UTC 2011


commit: http://git.uclibc.org/uClibc/commit/?id=1f2f98a7da28bd331a62f8c64a017603fa0c02e2
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/future

Change CANCELLATION_P macro and adapt usage.

Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>
---
 libc/unistd/sleep.c                  |    1 +
 libpthread/nptl/pthreadP.h           |    2 +-
 libpthread/nptl/pthread_testcancel.c |    1 +
 3 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/libc/unistd/sleep.c b/libc/unistd/sleep.c
index 9db115a..64753a8 100644
--- a/libc/unistd/sleep.c
+++ b/libc/unistd/sleep.c
@@ -99,6 +99,7 @@ unsigned int sleep (unsigned int seconds)
     /* This is not necessary but some buggy programs depend on this.  */
     if (seconds == 0) {
 #  ifdef CANCELLATION_P
+	int cancelhandling;
 	CANCELLATION_P (THREAD_SELF);
 #  endif
 	return 0;
diff --git a/libpthread/nptl/pthreadP.h b/libpthread/nptl/pthreadP.h
index fb354ea..e740486 100644
--- a/libpthread/nptl/pthreadP.h
+++ b/libpthread/nptl/pthreadP.h
@@ -221,7 +221,7 @@ extern int __pthread_debug attribute_hidden;
 /* Cancellation test.  */
 #define CANCELLATION_P(self) \
   do {									      \
-    int cancelhandling = THREAD_GETMEM (self, cancelhandling);		      \
+    cancelhandling = THREAD_GETMEM (self, cancelhandling);		      \
     if (CANCEL_ENABLED_AND_CANCELED (cancelhandling))			      \
       {									      \
 	THREAD_SETMEM (self, result, PTHREAD_CANCELED);			      \
diff --git a/libpthread/nptl/pthread_testcancel.c b/libpthread/nptl/pthread_testcancel.c
index e9b17b4..fbd597a 100644
--- a/libpthread/nptl/pthread_testcancel.c
+++ b/libpthread/nptl/pthread_testcancel.c
@@ -24,5 +24,6 @@
 void
 pthread_testcancel (void)
 {
+  int cancelhandling;
   CANCELLATION_P (THREAD_SELF);
 }
-- 
1.7.3.4



More information about the uClibc-cvs mailing list