[git commit master 1/1] nptl: get rid of preprocessor warning when __ASSUME_TGKILL is not defined

Carmelo Amoroso carmelo.amoroso at st.com
Tue Jan 4 13:16:50 UTC 2011


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

A sample of the warning reported while building for ARM that has not __ASSUME_TGKILL defined.

libpthread/nptl/sysdeps/unix/sysv/linux/raise.c: In function 'raise':
libpthread/nptl/sysdeps/unix/sysv/linux/raise.c:33:5: warning: "__ASSUME_TGKILL" is not defined

Signed-off-by: Carmelo Amoroso <carmelo.amoroso at st.com>
---
 libpthread/nptl/pthread_cancel.c                   |    2 +-
 libpthread/nptl/sysdeps/pthread/createthread.c     |    2 +-
 libpthread/nptl/sysdeps/unix/sysv/linux/pt-raise.c |    4 ++--
 .../nptl/sysdeps/unix/sysv/linux/pthread_kill.c    |    2 +-
 libpthread/nptl/sysdeps/unix/sysv/linux/raise.c    |    8 ++++----
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/libpthread/nptl/pthread_cancel.c b/libpthread/nptl/pthread_cancel.c
index 4a958bc..163fa02 100644
--- a/libpthread/nptl/pthread_cancel.c
+++ b/libpthread/nptl/pthread_cancel.c
@@ -76,7 +76,7 @@ pthread_cancel (
 	     a signal handler.  But this is no allowed, pthread_cancel
 	     is not guaranteed to be async-safe.  */
 	  int val;
-#if __ASSUME_TGKILL
+#if defined(__ASSUME_TGKILL) && __ASSUME_TGKILL
 	  val = INTERNAL_SYSCALL (tgkill, err, 3,
 				  THREAD_GETMEM (THREAD_SELF, pid), pd->tid,
 				  SIGCANCEL);
diff --git a/libpthread/nptl/sysdeps/pthread/createthread.c b/libpthread/nptl/sysdeps/pthread/createthread.c
index a676e27..ce86f5f 100644
--- a/libpthread/nptl/sysdeps/pthread/createthread.c
+++ b/libpthread/nptl/sysdeps/pthread/createthread.c
@@ -106,7 +106,7 @@ do_clone (struct pthread *pd, const struct pthread_attr *attr,
 		 send it the cancellation signal.  */
 	      INTERNAL_SYSCALL_DECL (err2);
 	    err_out:
-#if __ASSUME_TGKILL
+#if defined (__ASSUME_TGKILL) && __ASSUME_TGKILL
 	      (void) INTERNAL_SYSCALL (tgkill, err2, 3,
 				       THREAD_GETMEM (THREAD_SELF, pid),
 				       pd->tid, SIGCANCEL);
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-raise.c b/libpthread/nptl/sysdeps/unix/sysv/linux/pt-raise.c
index d256ebc..622bb66 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-raise.c
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/pt-raise.c
@@ -28,7 +28,7 @@ int
 raise (
      int sig)
 {
-#if __ASSUME_TGKILL || defined __NR_tgkill
+#if (defined(__ASSUME_TGKILL) && __ASSUME_TGKILL) || defined __NR_tgkill
   /* raise is an async-safe function.  It could be called while the
      fork function temporarily invalidated the PID field.  Adjust for
      that.  */
@@ -37,7 +37,7 @@ raise (
     pid = -pid;
 #endif
 
-#if __ASSUME_TGKILL
+#if defined(__ASSUME_TGKILL) && __ASSUME_TGKILL
   return INLINE_SYSCALL (tgkill, 3, pid, THREAD_GETMEM (THREAD_SELF, tid),
 			 sig);
 #else
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_kill.c b/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_kill.c
index 3a70c37..2d6bb80 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_kill.c
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_kill.c
@@ -59,7 +59,7 @@ __pthread_kill (
      fork, it would have to happen in a signal handler.  But this is
      no allowed, pthread_kill is not guaranteed to be async-safe.  */
   int val;
-#if __ASSUME_TGKILL
+#if defined(__ASSUME_TGKILL) && __ASSUME_TGKILL
   val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid),
 			  tid, signo);
 #else
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/raise.c b/libpthread/nptl/sysdeps/unix/sysv/linux/raise.c
index da35cfe..708ed6d 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/raise.c
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/raise.c
@@ -30,7 +30,7 @@ raise (
      int sig)
 {
   struct pthread *pd = THREAD_SELF;
-#if __ASSUME_TGKILL || defined __NR_tgkill
+#if (defined(__ASSUME_TGKILL) && __ASSUME_TGKILL) || defined __NR_tgkill
   pid_t pid = THREAD_GETMEM (pd, pid);
 #endif
   pid_t selftid = THREAD_GETMEM (pd, tid);
@@ -45,13 +45,13 @@ raise (
 #endif
       THREAD_SETMEM (pd, tid, selftid);
 
-#if __ASSUME_TGKILL || defined __NR_tgkill
+#if (defined(__ASSUME_TGKILL) && __ASSUME_TGKILL) || defined __NR_tgkill
       /* We do not set the PID field in the TID here since we might be
 	 called from a signal handler while the thread executes fork.  */
       pid = selftid;
 #endif
     }
-#if __ASSUME_TGKILL || defined __NR_tgkill
+#if (defined(__ASSUME_TGKILL) && __ASSUME_TGKILL) || defined __NR_tgkill
   else
     /* raise is an async-safe function.  It could be called while the
        fork/vfork function temporarily invalidated the PID field.  Adjust for
@@ -60,7 +60,7 @@ raise (
       pid = (pid & INT_MAX) == 0 ? selftid : -pid;
 #endif
 
-#if __ASSUME_TGKILL
+#if defined(__ASSUME_TGKILL) && __ASSUME_TGKILL
   return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
 #else
 # ifdef __NR_tgkill
-- 
1.7.2.2



More information about the uClibc-cvs mailing list