aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
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 /sysdeps
parentaa0e1b599cc4d836067fb1157ee16315f2f62439 (diff)
downloadglibc-786db2208ef0e9eae365c56764f3050b73e23e56.zip
glibc-786db2208ef0e9eae365c56764f3050b73e23e56.tar.gz
glibc-786db2208ef0e9eae365c56764f3050b73e23e56.tar.bz2
*** 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.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/mach/hurd/i386/sigreturn.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sysdeps/mach/hurd/i386/sigreturn.c b/sysdeps/mach/hurd/i386/sigreturn.c
index 0e5ccfc..d47b863 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)