public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] hurd: Fix some broken indentation
@ 2023-03-01 23:33 Samuel Thibault
  0 siblings, 0 replies; only message in thread
From: Samuel Thibault @ 2023-03-01 23:33 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0d41182e0e987b0a256d55152c36103c88b35585

commit 0d41182e0e987b0a256d55152c36103c88b35585
Author: Sergey Bugaev <bugaevc@gmail.com>
Date:   Wed Mar 1 19:23:55 2023 +0300

    hurd: Fix some broken indentation
    
    Also, fix a couple of typos. No functional change.
    
    Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
    Message-Id: <20230301162355.426887-2-bugaevc@gmail.com>

Diff:
---
 hurd/hurdsig.c | 101 +++++++++++++++++++++++++++++----------------------------
 1 file changed, 51 insertions(+), 50 deletions(-)

diff --git a/hurd/hurdsig.c b/hurd/hurdsig.c
index 5ff0a91fea..85bd46b525 100644
--- a/hurd/hurdsig.c
+++ b/hurd/hurdsig.c
@@ -202,7 +202,7 @@ _hurd_sigstate_unlock (struct hurd_sigstate *ss)
 }
 libc_hidden_def (_hurd_sigstate_set_global_rcv)
 
-/* Retreive a thread's full set of pending signals, including the global
+/* Retrieve a thread's full set of pending signals, including the global
    ones if appropriate.  SS must be locked.  */
 sigset_t
 _hurd_sigstate_pending (const struct hurd_sigstate *ss)
@@ -233,7 +233,7 @@ sigstate_clear_pending (struct hurd_sigstate *ss, int signo)
 libc_hidden_def (_hurd_sigstate_lock)
 libc_hidden_def (_hurd_sigstate_unlock)
 
-/* Retreive a thread's action vector.  SS must be locked.  */
+/* Retrieve a thread's action vector.  SS must be locked.  */
 struct sigaction *
 _hurd_sigstate_actions (struct hurd_sigstate *ss)
 {
@@ -451,54 +451,55 @@ _hurdsig_abort_rpcs (struct hurd_sigstate *ss, int signo, int sigthread,
       *state_change = 1;
     }
   else if (state->basic.PC == (uintptr_t) &_hurd_intr_rpc_msg_in_trap
-	   /* The thread was blocked in the system call.  After thread_abort,
-	      the return value register indicates what state the RPC was in
-	      when interrupted.  */
-	   && state->basic.SYSRETURN == MACH_RCV_INTERRUPTED)
-      {
-	/* The RPC request message was sent and the thread was waiting for
-	   the reply message; now the message receive has been aborted, so
-	   the mach_msg call will return MACH_RCV_INTERRUPTED.  We must tell
-	   the server to interrupt the pending operation.  The thread must
-	   wait for the reply message before running the signal handler (to
-	   guarantee that the operation has finished being interrupted), so
-	   our nonzero return tells the trampoline code to finish the message
-	   receive operation before running the handler.  */
-
-	mach_port_t *reply = interrupted_reply_port_location (ss->thread,
-							      state,
-							      sigthread);
-	error_t err = __interrupt_operation (intr_port, _hurdsig_interrupt_timeout);
-
-	if (err)
-	  {
-	    if (reply)
-	      {
-		/* The interrupt didn't work.
-		   Destroy the receive right the thread is blocked on.  */
-		__mach_port_destroy (__mach_task_self (), *reply);
-		*reply = MACH_PORT_NULL;
-	      }
-
-	    /* The system call return value register now contains
-	       MACH_RCV_INTERRUPTED; when mach_msg resumes, it will retry the
-	       call.  Since we have just destroyed the receive right, the
-	       retry will fail with MACH_RCV_INVALID_NAME.  Instead, just
-	       change the return value here to EINTR so mach_msg will not
-	       retry and the EINTR error code will propagate up.  */
-	    state->basic.SYSRETURN = EINTR;
-	    *state_change = 1;
-	  }
-	else if (reply)
-	  rcv_port = *reply;
-
-	/* All threads whose RPCs were interrupted by the interrupt_operation
-	   call above will retry their RPCs unless we clear SS->intr_port.
-	   So we clear it for the thread taking a signal when SA_RESTART is
-	   clear, so that its call returns EINTR.  */
-	if (! signo || !(_hurd_sigstate_actions (ss) [signo].sa_flags & SA_RESTART))
-	  ss->intr_port = MACH_PORT_NULL;
-      }
+           /* The thread was blocked in the system call.  After thread_abort,
+              the return value register indicates what state the RPC was in
+              when interrupted.  */
+           && state->basic.SYSRETURN == MACH_RCV_INTERRUPTED)
+    {
+      /* The RPC request message was sent and the thread was waiting for the
+         reply message; now the message receive has been aborted, so the
+         mach_msg call will return MACH_RCV_INTERRUPTED.  We must tell the
+         server to interrupt the pending operation.  The thread must wait for
+         the reply message before running the signal handler (to guarantee that
+         the operation has finished being interrupted), so our nonzero return
+         tells the trampoline code to finish the message receive operation
+         before running the handler.  */
+
+      mach_port_t *reply = interrupted_reply_port_location (ss->thread,
+                                                            state,
+                                                            sigthread);
+      error_t err = __interrupt_operation (intr_port,
+                                           _hurdsig_interrupt_timeout);
+
+      if (err)
+        {
+          if (reply)
+            {
+              /* The interrupt didn't work.
+                 Destroy the receive right the thread is blocked on.  */
+              __mach_port_destroy (__mach_task_self (), *reply);
+              *reply = MACH_PORT_NULL;
+            }
+
+          /* The system call return value register now contains
+             MACH_RCV_INTERRUPTED; when mach_msg resumes, it will retry the
+             call.  Since we have just destroyed the receive right, the retry
+             will fail with MACH_RCV_INVALID_NAME.  Instead, just change the
+             return value here to EINTR so mach_msg will not retry and the
+             EINTR error code will propagate up.  */
+          state->basic.SYSRETURN = EINTR;
+          *state_change = 1;
+	}
+      else if (reply)
+        rcv_port = *reply;
+
+      /* All threads whose RPCs were interrupted by the interrupt_operation
+         call above will retry their RPCs unless we clear SS->intr_port.  So we
+         clear it for the thread taking a signal when SA_RESTART is clear, so
+         that its call returns EINTR.  */
+      if (! signo || !(_hurd_sigstate_actions (ss) [signo].sa_flags & SA_RESTART))
+        ss->intr_port = MACH_PORT_NULL;
+    }
 
   return rcv_port;
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-01 23:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-01 23:33 [glibc] hurd: Fix some broken indentation Samuel Thibault

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).