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

hurd: Avoid extra ctty RPCs in init_dtable ()



It is common to have (some of) stdin, stdout and stderr point to the
very same port. We were making the ctty RPCs that _hurd_port2fd () does
for each one of them separately:

1. term_getctty ()
2. mach_port_deallocate ()
3. term_open_ctty ()

Instead, let's detect this case and duplicate the ctty port we already
have. This means we do 1 RPC instead of 3 (and create a single protid
on the server side) if the file is our ctty, and no RPCs instead of 1
if it's not. A clear win!

Signed-off-by: default avatarSergey Bugaev <bugaevc@gmail.com>
parent 76d0f094
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