about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2015-05-22 10:18:17 -0700
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2016-06-07 10:38:01 -0300
commit02b2a805268e2213cfbdc9bd50245a0a47724819 (patch)
tree9edafe92b19b275be178f350e6fa3a5bb07d7085
parent9ac61c0047295696cbcdbc26bdc174c7bd25a3c8 (diff)
downloadglibc-02b2a805268e2213cfbdc9bd50245a0a47724819.tar.gz
glibc-02b2a805268e2213cfbdc9bd50245a0a47724819.tar.xz
glibc-02b2a805268e2213cfbdc9bd50245a0a47724819.zip
Fix nptl-init.c use of INTERNAL_SYSCALL_DECL.
-rw-r--r--ChangeLog6
-rw-r--r--nptl/nptl-init.c30
2 files changed, 25 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 423d71554c..3919fe9894 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-05-22  Roland McGrath  <roland@hack.frob.com>
+
+	* nptl/nptl-init.c (__pthread_initialize_minimal_internal):
+	Use a separate INTERNAL_SYSCALL_DECL (err); in a local scope
+	for each INTERNAL_SYSCALL use.
+
 2016-06-03  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
 	* nptl/pthread_mutex_init.c [__ASSUME_FUTEX_LOCK_PI]
diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c
index 1ad41c5bb3..7f2043dc33 100644
--- a/nptl/nptl-init.c
+++ b/nptl/nptl-init.c
@@ -324,19 +324,22 @@ __pthread_initialize_minimal_internal (void)
 #endif
 
   /* Initialize the robust mutex data.  */
+  {
 #ifdef __PTHREAD_MUTEX_HAVE_PREV
-  pd->robust_prev = &pd->robust_head;
+    pd->robust_prev = &pd->robust_head;
 #endif
-  pd->robust_head.list = &pd->robust_head;
+    pd->robust_head.list = &pd->robust_head;
 #ifdef __NR_set_robust_list
-  pd->robust_head.futex_offset = (offsetof (pthread_mutex_t, __data.__lock)
-				  - offsetof (pthread_mutex_t,
-					      __data.__list.__next));
-  int res = INTERNAL_SYSCALL (set_robust_list, err, 2, &pd->robust_head,
-			      sizeof (struct robust_list_head));
-  if (INTERNAL_SYSCALL_ERROR_P (res, err))
+    pd->robust_head.futex_offset = (offsetof (pthread_mutex_t, __data.__lock)
+				    - offsetof (pthread_mutex_t,
+						__data.__list.__next));
+    INTERNAL_SYSCALL_DECL (err);
+    int res = INTERNAL_SYSCALL (set_robust_list, err, 2, &pd->robust_head,
+				sizeof (struct robust_list_head));
+    if (INTERNAL_SYSCALL_ERROR_P (res, err))
 #endif
-    set_robust_list_not_avail ();
+      set_robust_list_not_avail ();
+  }
 
 #ifdef __NR_futex
 # ifndef __ASSUME_PRIVATE_FUTEX
@@ -344,6 +347,7 @@ __pthread_initialize_minimal_internal (void)
      doing the test once this early is beneficial.  */
   {
     int word = 0;
+    INTERNAL_SYSCALL_DECL (err);
     word = INTERNAL_SYSCALL (futex, err, 3, &word,
 			    FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1);
     if (!INTERNAL_SYSCALL_ERROR_P (word, err))
@@ -364,6 +368,7 @@ __pthread_initialize_minimal_internal (void)
 	 is irrelevant.  Given that passing six parameters is difficult
 	 on some architectures we just pass whatever random value the
 	 calling convention calls for to the kernel.  It causes no harm.  */
+      INTERNAL_SYSCALL_DECL (err);
       word = INTERNAL_SYSCALL (futex, err, 5, &word,
 			       FUTEX_WAIT_BITSET | FUTEX_CLOCK_REALTIME
 			       | FUTEX_PRIVATE_FLAG, 1, NULL, 0);
@@ -416,8 +421,11 @@ __pthread_initialize_minimal_internal (void)
 # ifdef SIGSETXID
   __sigaddset (&sa.sa_mask, SIGSETXID);
 # endif
-  (void) INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_UNBLOCK, &sa.sa_mask,
-			   NULL, _NSIG / 8);
+  {
+    INTERNAL_SYSCALL_DECL (err);
+    (void) INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_UNBLOCK, &sa.sa_mask,
+			     NULL, _NSIG / 8);
+  }
 #endif
 
   /* Get the size of the static and alignment requirements for the TLS