Skip to content
Commit 8f81f589 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov
Browse files

tty, restore: Migrate tty slave peer connection if --shell-job passed



In case if we've dumped a slave peer only (say a user dumped `top'
application) we should migrate it on current active terminal, which
barely an own standart stream prepared for us by the file engine.

Note only one external slave peer is allowed simply because
otherwise we can't distinguish which indices should be used
for each of them.

The patch basically does the following things

 - Check if the SID present on peer exist in current
   process tree, we need to be sure that we can restore
   peer parameters and controlling terminal if present

 - Rename pty_open_fake_ptmx to pty_open_unpaired_slave
   because we might be inheriting SELF_STDIN_OFF instead
   of opening fake master peer

 - Do inherit SELF_STDIN_OFF and restore tty group if
   we are restoring external tty

Signed-off-by: default avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: default avatarPavel Emelyanov <xemul@parallels.com>
parent bee5ddfb
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