Skip to content
Commit 346b6eab authored by Sergey Bugaev's avatar Sergey Bugaev Committed by Samuel Thibault
Browse files

hurd: Run init_pids () before init_dtable ()



Much as the comment says, things on _hurd_subinit assume that _hurd_pid
is already initialized by the time _hurd_subinit is run, so
_hurd_proc_subinit has to run before it. Specifically, init_dtable ()
calls _hurd_port2fd (), which uses _hurd_pid and _hurd_pgrp to set up
ctty handling. With _hurd_subinit running before _hurd_proc_subinit,
ctty setup was broken:

  13<--33(pid1255)->term_getctty () = 0    4<--39(pid1255)
task16(pid1255)->mach_port_deallocate (pn{ 10}) = 0
  13<--33(pid1255)->term_open_ctty (0 0) = 0x40000016 (Invalid argument)

Fix this by running the _hurd_proc_subinit hook in the correct place --
just after _hurd_portarray is set up (so the proc server port is
available in its usual place) and just before running _hurd_subinit.

Fixes 1ccbb925
("hurd: Notify the proc server later during initialization").

Signed-off-by: default avatarSergey Bugaev <bugaevc@gmail.com>
parent e411e31b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment