This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 5/8] Hurd signals: reindent


* hurd/hurdsig.c (post_pending): reindent.
---
 hurd/hurdsig.c |   66 ++++++++++++++++++++++++++++----------------------------
 1 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/hurd/hurdsig.c b/hurd/hurdsig.c
index 6923c87..234da1e 100644
--- a/hurd/hurdsig.c
+++ b/hurd/hurdsig.c
@@ -943,96 +943,96 @@ post_signal (struct hurd_sigstate *ss,
 	assert_perror (err);
 	thread_state.set = 0;	/* Everything we know is now wrong.  */
 	break;
       }
     }
 
   return 1;
 }
 
 /* Return the set of pending signals in SS which should be delivered. */
 static sigset_t
 pending_signals (struct hurd_sigstate *ss)
 {
   /* We don't worry about any pending signals if we are stopped, nor if
      SS is in a critical section.  We are guaranteed to get a sig_post
      message before any of them become deliverable: either the SIGCONT
      signal, or a sig_post with SIGNO==0 as an explicit poll when the
      thread finishes its critical section.  */
   if (_hurd_stopped || __spin_lock_locked (&ss->critical_section_lock))
     return 0;
 
   return ss->pending & ~ss->blocked;
 }
 
 /* Post the specified pending signals in SS and return 1.  If one of
    them is traced, abort immediately and return 0.  SS must be locked on
    entry and will be unlocked in all cases.  */
 static int
 post_pending (struct hurd_sigstate *ss, sigset_t pending, void (*reply) (void))
 {
-    int signo;
-    struct hurd_signal_detail detail;
+  int signo;
+  struct hurd_signal_detail detail;
 
-	for (signo = 1; signo < NSIG; ++signo)
-	  if (__sigismember (&pending, signo))
-	    {
-	      __sigdelset (&ss->pending, signo);
-	      detail = ss->pending_data[signo];
-	      __spin_unlock (&ss->lock);
-
-	      /* Will reacquire the lock, except if the signal is traced.  */
-	      if (! post_signal (ss, signo, &detail, 0, reply))
-		return 0;
-	    }
-
-	/* No more signals pending; SS->lock is still locked.
-	   Wake up any sigsuspend call that is blocking SS->thread.  */
-	if (ss->suspended != MACH_PORT_NULL)
-	  {
-	    /* There is a sigsuspend waiting.  Tell it to wake up.  */
-	    error_t err;
-	    mach_msg_header_t msg;
-	    msg.msgh_bits = MACH_MSGH_BITS (MACH_MSG_TYPE_MAKE_SEND, 0);
-	    msg.msgh_remote_port = ss->suspended;
-	    msg.msgh_local_port = MACH_PORT_NULL;
-	    /* These values do not matter.  */
-	    msg.msgh_id = 8675309; /* Jenny, Jenny.  */
-	    ss->suspended = MACH_PORT_NULL;
-	    err = __mach_msg (&msg, MACH_SEND_MSG, sizeof msg, 0,
-			      MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE,
-			      MACH_PORT_NULL);
-	    assert_perror (err);
-	  }
+  for (signo = 1; signo < NSIG; ++signo)
+    if (__sigismember (&pending, signo))
+      {
+	__sigdelset (&ss->pending, signo);
+	detail = ss->pending_data[signo];
 	__spin_unlock (&ss->lock);
 
-    return 1;
+	/* Will reacquire the lock, except if the signal is traced.  */
+	if (! post_signal (ss, signo, &detail, 0, reply))
+	  return 0;
+      }
+
+  /* No more signals pending; SS->lock is still locked.
+     Wake up any sigsuspend call that is blocking SS->thread.  */
+  if (ss->suspended != MACH_PORT_NULL)
+    {
+      /* There is a sigsuspend waiting.  Tell it to wake up.  */
+      error_t err;
+      mach_msg_header_t msg;
+      msg.msgh_bits = MACH_MSGH_BITS (MACH_MSG_TYPE_MAKE_SEND, 0);
+      msg.msgh_remote_port = ss->suspended;
+      msg.msgh_local_port = MACH_PORT_NULL;
+      /* These values do not matter.  */
+      msg.msgh_id = 8675309; /* Jenny, Jenny.  */
+      ss->suspended = MACH_PORT_NULL;
+      err = __mach_msg (&msg, MACH_SEND_MSG, sizeof msg, 0,
+			MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE,
+			MACH_PORT_NULL);
+      assert_perror (err);
+    }
+  __spin_unlock (&ss->lock);
+
+  return 1;
 }
 
 /* Post all the pending signals of all threads and return 1.  If a traced
    signal is encountered, abort immediately and return 0.  */
 static int
 post_all_pending_signals (void (*reply) (void))
 {
   struct hurd_sigstate *ss;
   sigset_t pending;
 
   for (;;)
     {
       __mutex_lock (&_hurd_siglock);
       for (ss = _hurd_sigstates; ss != NULL; ss = ss->next)
         {
 	  __spin_lock (&ss->lock);
 
 	  pending = pending_signals (ss);
 	  if (pending)
 	    /* post_pending() below will unlock SS. */
 	    break;
 
 	  __spin_unlock (&ss->lock);
 	}
       __mutex_unlock (&_hurd_siglock);
 
       if (! pending)
 	return 1;
       if (! post_pending (ss, pending, reply))
 	return 0;
-- 
1.7.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]