about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-04-06 01:51:07 +0000
committerMiles Bader <miles@gnu.org>1996-04-06 01:51:07 +0000
commit786db2208ef0e9eae365c56764f3050b73e23e56 (patch)
treeef1864a486bf0b5752abfa0166fdd8a9d8a2e076
parentaa0e1b599cc4d836067fb1157ee16315f2f62439 (diff)
downloadglibc-786db2208ef0e9eae365c56764f3050b73e23e56.tar.gz
glibc-786db2208ef0e9eae365c56764f3050b73e23e56.tar.xz
glibc-786db2208ef0e9eae365c56764f3050b73e23e56.zip
*** empty log message ***
Fri Apr  5 17:43:41 1996  Miles Bader  <miles@gnu.ai.mit.edu>

	* sysdeps/mach/hurd/i386/sigreturn.c (__sigreturn): Store
	MACH_PORT_DEAD in the thread reply-port variable before destroying
	the signal handler's reply port to avoid infinite recursion.
	* sysdeps/mach/hurd/mig-reply.c (__mig_dealloc_reply_port): Only
	attempt to destroy PORT if it's a valid port name.
-rw-r--r--ChangeLog8
-rw-r--r--sysdeps/mach/hurd/i386/sigreturn.c14
2 files changed, 20 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 65293eabdb..a6098807e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Fri Apr  5 17:43:41 1996  Miles Bader  <miles@gnu.ai.mit.edu>
+
+	* sysdeps/mach/hurd/i386/sigreturn.c (__sigreturn): Store
+	MACH_PORT_DEAD in the thread reply-port variable before destroying
+	the signal handler's reply port to avoid infinite recursion.
+	* sysdeps/mach/hurd/mig-reply.c (__mig_dealloc_reply_port): Only
+	attempt to destroy PORT if it's a valid port name.
+
 Wed Apr  3 17:10:44 1996  Roland McGrath  <roland@whiz-bang.gnu.ai.mit.edu>
 
 	* extra-lib.mk: Put libs in $(common-objpfx) instead of $(objpfx).
diff --git a/sysdeps/mach/hurd/i386/sigreturn.c b/sysdeps/mach/hurd/i386/sigreturn.c
index 0e5ccfc9f5..d47b863fe1 100644
--- a/sysdeps/mach/hurd/i386/sigreturn.c
+++ b/sysdeps/mach/hurd/i386/sigreturn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1994, 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
@@ -80,7 +80,17 @@ __sigreturn (struct sigcontext *scp)
   reply_port =
     (mach_port_t *) __hurd_threadvar_location (_HURD_THREADVAR_MIG_REPLY);
   if (*reply_port)
-    __mach_port_destroy (__mach_task_self (), *reply_port);
+    {
+      mach_port_t port = *reply_port;
+
+      /* Assigning MACH_PORT_DEAD here tells libc's mig_get_reply_port not to
+	 get another reply port, but avoids mig_dealloc_reply_port trying to
+	 deallocate it after the receive fails (which it will, because the
+	 reply port will be bogus, whether we do this or not).  */
+      *reply_port = MACH_PORT_DEAD;
+
+      __mach_port_destroy (__mach_task_self (), port);
+    }
   *reply_port = scp->sc_reply_port;
 
   if (scp->sc_fpused)