git-ctty
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Tue, 30 Jan 2024 18:20:04 +0000 (19:20 +0100)
committerAurelien Jarno <aurel32@debian.org>
Tue, 30 Jan 2024 18:20:04 +0000 (19:20 +0100)
commit07bffbc69e27d7b1134afc869a698f405c54fdc9
tree11bdbaae12ce659d9f86dd2073bc58dfd9deb93e
parent729cdbcd750bed5ee6d650b5f48d6b40147fa19d
git-ctty

commit 346b6eab3c14ead0b716d53e2235464b822f48f2
Author: Sergey Bugaev <bugaevc@gmail.com>
Date:   Sat Apr 15 22:08:56 2023 +0300

    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 1ccbb9258eed0f667edf459a28ba23a805549b36
    ("hurd: Notify the proc server later during initialization").

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
Gbp-Pq: Topic hurd-i386
Gbp-Pq: Name git-ctty.diff
hurd/hurdinit.c