]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
hurd: install correct number of send rights on fork
authorThomas Schwinge <thomas@codesourcery.com>
Sun, 29 Nov 2015 15:41:00 +0000 (16:41 +0100)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 29 Nov 2015 15:41:00 +0000 (16:41 +0100)
* sysdeps/mach/hurd/fork.c (__fork): Install correct number of send
rights for its main user thread in NEWTASK.

ChangeLog
sysdeps/mach/hurd/fork.c

index d4dc8a447d3a318a784b50cfbf33841d61eaf51a..62beb762c4dada59699b5218774d813d9495dc98 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-11-29  Thomas Schwinge  <thomas@codesourcery.com>
+
+       * sysdeps/mach/hurd/fork.c (__fork): Install correct number of send
+       rights for its main user thread in NEWTASK.
+
 2015-11-28  Maciej W. Rozycki  <macro@imgtec.com>
 
        * sysdeps/mips/fpu_control.h (_FPU_RESERVED): Include ABS2008.
index 04d81e1d1d0073510d0eb4aac7de7a970de9d359..d4baed54c8110d8d9753f72b375c8d23fef15c7d 100644 (file)
@@ -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)) ||