about summary refs log tree commit diff
path: root/hurd/intr-msg.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-01-04 10:00:22 +0000
committerRoland McGrath <roland@gnu.org>1996-01-04 10:00:22 +0000
commitfb8e70d6dd3a9c3a0e0d2713b5be3cbc9d7a6409 (patch)
treed465aa6b6c500395145dc09bc4ea448392cf1a6a /hurd/intr-msg.c
parent67f27f3a02d623331a56cddee2a56c34b3b13bd9 (diff)
downloadglibc-fb8e70d6dd3a9c3a0e0d2713b5be3cbc9d7a6409.tar.gz
glibc-fb8e70d6dd3a9c3a0e0d2713b5be3cbc9d7a6409.tar.xz
glibc-fb8e70d6dd3a9c3a0e0d2713b5be3cbc9d7a6409.zip
Wed Jan 3 20:23:42 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu> cvs/libc-960104
	* hurd/catch-signal.c: New file.

	* hurd/intr-msg.c: When restarting RPC, fetch a new reply port.

	* hurd/hurdsig.c: Use new hurdfault.h interface.
	(abort_all_rpcs): Mutate return value to EINTR in threads whose
	replies we will wait for.

	* hurd/hurdkill.c (_hurd_sig_post): When doing pgrp, make sure we
	do ourselves last.

Wed Jan  3 19:17:10 1996  Miles Bader  <miles@gnu.ai.mit.edu>

	* sysdeps/mach/hurd/access.c (__access): Put the uid/gid arguments
	to auth_makeauth() in the right order.

Wed Jan  3 17:19:04 1996  Roland McGrath  <roland@churchy.gnu.ai.mit.edu>

	* sysdeps/generic/strsep.c: Rewritten.

	* sysdeps/mach/hurd/fork.c: Use a different workaround for the
 	suspended page fault deadlock kernel bug: thread_abort our signal
 	thread first thing after proc_dostop.

	* sysdeps/mach/hurd/setgid.c: Rewrote gid frobnication to
	recognize rootness properly.

	* hurd/hurdsig.c: Use new signal preemption interface.
Diffstat (limited to 'hurd/intr-msg.c')
-rw-r--r--hurd/intr-msg.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/hurd/intr-msg.c b/hurd/intr-msg.c
index 41f43e1e28..9362731240 100644
--- a/hurd/intr-msg.c
+++ b/hurd/intr-msg.c
@@ -1,5 +1,5 @@
 /* Replacement for mach_msg used in interruptible Hurd RPCs.
-Copyright (C) 1995 Free Software Foundation, Inc.
+Copyright (C) 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@ Cambridge, MA 02139, USA.  */
 
 #include <mach.h>
 #include <mach/mig_errors.h>
+#include <mach/mig_support.h>
 #include <hurd/signal.h>
 
 #include "intr-msg.h"
@@ -45,7 +46,7 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg,
      return EINTR when some other thread gets a signal, in which case we
      want to restart our call.  */
   ss->intr_port = msg->msgh_remote_port;
-  
+
   /* A signal may arrive here, after intr_port is set, but before
      the mach_msg system call.  The signal handler might do an
      interruptible RPC, and clobber intr_port; then it would not be
@@ -58,12 +59,12 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg,
 
   if (ss->cancel)
     {
-      err = EINTR;
       ss->cancel = 0;
+      return EINTR;
     }
-  else 
-    err = INTR_MSG_TRAP (msg, option, send_size,
-			 rcv_size, rcv_name, timeout, notify);
+
+  err = INTR_MSG_TRAP (msg, option, send_size,
+		       rcv_size, rcv_name, timeout, notify);
 
   switch (err)
     {
@@ -83,7 +84,14 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg,
 	   signal thread will have cleared SS->intr_port.
 	   Since it's not cleared, the signal was for another thread,
 	   or SA_RESTART is set.  Restart the interrupted call.  */
-	goto message;
+	{
+	restart:
+	  if (rcv_name != MACH_PORT_NULL)
+	    /* Make sure we have a valid reply port.  The one we were using
+	       may have been destroyed by interruption.  */
+	    msg->msgh_local_port = rcv_name = __mig_get_reply_port ();
+	  goto message;
+	}
       /* FALLTHROUGH */
 
     case MACH_RCV_PORT_DIED:
@@ -139,7 +147,7 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg,
 	      if (ss->intr_port != MACH_PORT_NULL)
 		/* Nope; repeat the RPC.
 		   XXX Resources moved? */
-		goto message;
+		goto restart;
 	      else
 		/* The EINTR return indicates cancellation, so clear the
                    flag.  */