aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/mach
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2015-11-29 16:41:00 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2015-11-29 16:41:00 +0100
commit894f3e131176c481c50484e3004a7a641db01373 (patch)
tree4d51bbeeef485c3e13891c3c42b50fc5faeecc61 /sysdeps/mach
parentdb4855bf0c6fa25f0e3e62c60deb43ffe527b07c (diff)
downloadglibc-894f3e131176c481c50484e3004a7a641db01373.zip
glibc-894f3e131176c481c50484e3004a7a641db01373.tar.gz
glibc-894f3e131176c481c50484e3004a7a641db01373.tar.bz2
hurd: install correct number of send rights on fork
* sysdeps/mach/hurd/fork.c (__fork): Install correct number of send rights for its main user thread in NEWTASK.
Diffstat (limited to 'sysdeps/mach')
-rw-r--r--sysdeps/mach/hurd/fork.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/sysdeps/mach/hurd/fork.c b/sysdeps/mach/hurd/fork.c
index 04d81e1..d4baed5 100644
--- a/sysdeps/mach/hurd/fork.c
+++ b/sysdeps/mach/hurd/fork.c
@@ -464,14 +464,10 @@ __fork (void)
(err = __mach_port_insert_right (newtask, ss->thread,
thread, MACH_MSG_TYPE_COPY_SEND)))
LOSE;
- /* We have one extra user reference created at the beginning of this
- function, accounted for by mach_port_names (and which will thus be
- accounted for in the child below). This extra right gets consumed
- in the child by the store into _hurd_sigthread in the child fork. */
if (thread_refs > 1 &&
(err = __mach_port_mod_refs (newtask, ss->thread,
MACH_PORT_RIGHT_SEND,
- thread_refs)))
+ thread_refs - 1)))
LOSE;
if ((_hurd_msgport_thread != MACH_PORT_NULL) /* Let user have none. */
&& ((err = __mach_port_deallocate (newtask, _hurd_msgport_thread)) ||