Commit c2f44646 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

tty: Mark collected tty in @tty_active_pairs bitmap

Upon reception of tty we need to mark it in @tty_active_pairs
bitmam thus we will be able to verify if

 - all active ttys obtained are paired
 - if not paired then only one external tty is allowed
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 3d84d00f
......@@ -815,6 +815,16 @@ static int collect_one_tty(void *obj, ProtobufCMessage *msg)
if (verify_info(info))
return -1;
/*
* The tty peers which have no @termios are hunged up,
* so don't mark them as active, we create them with
* faked master and they are rather a rudiment which
* can't be used. Most likely they appear if a user has
* dumped program when it was closing a peer.
*/
if (info->tie->termios)
tty_test_and_set(info->tfe->tty_info_id, tty_active_pairs);
pr_info("Collected tty ID %#x\n", info->tfe->id);
list_add(&info->list, &all_ttys);
......
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