Commit 5cb16341 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

tty: Lookup for controlling tty iif sid provided

This is rather a code tossing for the next patch.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 1b060e14
...@@ -682,15 +682,19 @@ static int tty_find_restoring_task(struct tty_info *info) ...@@ -682,15 +682,19 @@ static int tty_find_restoring_task(struct tty_info *info)
{ {
struct pstree_item *item; struct pstree_item *item;
if (info->tie->sid == 0) if (info->tie->sid) {
pr_info("Set a control terminal %x to %d\n",
info->tfe->id, info->tie->sid);
for_each_pstree_item(item) {
if (item->sid == info->tie->sid)
return prepare_ctl_tty(item->pid.virt,
item->rst,
info->tfe->id);
}
} else
return 0; return 0;
pr_info("Set a control terminal to %d\n", info->tie->sid);
for_each_pstree_item(item)
if (item->sid == info->tie->sid)
return prepare_ctl_tty(item->pid.virt, item->rst, info->tfe->id);
if (opts.shell_job && !pty_is_master(info)) { if (opts.shell_job && !pty_is_master(info)) {
info->tie->sid = info->tie->pgrp = INHERIT_SID; info->tie->sid = info->tie->pgrp = INHERIT_SID;
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment