[git commit] pthreadP.h: avoid shadow warnings
Bernhard Reutner-Fischer
rep.dot.nop at gmail.com
Fri Jun 15 12:00:29 UTC 2012
commit: http://git.uclibc.org/uClibc/commit/?id=293173f87072bbc0cafc457d5d8a6039f4d1d259
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master
Change CANCELLATION_P macro and adapt usage.
Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
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 850562b..ae24afd 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);
}
More information about the uClibc-cvs
mailing list