Browse Source

pthreadP.h: avoid shadow warnings

Change CANCELLATION_P macro and adapt usage.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Peter S. Mazinger 13 years ago
parent
commit
293173f870
3 changed files with 3 additions and 1 deletions
  1. 1 0
      libc/unistd/sleep.c
  2. 1 1
      libpthread/nptl/pthreadP.h
  3. 1 0
      libpthread/nptl/pthread_testcancel.c

+ 1 - 0
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;

+ 1 - 1
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);			      \

+ 1 - 0
libpthread/nptl/pthread_testcancel.c

@@ -24,5 +24,6 @@
 void
 pthread_testcancel (void)
 {
+  int cancelhandling;
   CANCELLATION_P (THREAD_SELF);
 }