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

tty: Mark living peers in tty_active_pairs bitmap

Will need it to verify that live tty pairs exist.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Acked-by: 's avatarAndrew Vagin <avagin@parallels.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent dd783030
......@@ -91,6 +91,7 @@ static LIST_HEAD(all_ttys);
*/
#define MAX_TTYS 1024
static DECLARE_BITMAP(tty_bitmap, (MAX_TTYS << 1));
static DECLARE_BITMAP(tty_active_pairs, (MAX_TTYS << 1));
/*
* /dev/ptmx is a shared resource between all tasks
......@@ -923,6 +924,15 @@ static int dump_pty_info(int lfd, u32 id, const struct fd_parms *p, int major, i
if (hangup)
return pb_write_one(fdset_fd(glob_fdset, CR_FD_TTY_INFO), &info, PB_TTY_INFO);
/*
* Now trace the paired/unpaired ttys. For example
* the task might have slave peer assigned but no
* master peer. Such "detached" master peers are
* not yet supported by our tool and better to
* inform a user about such situatio,
*/
tty_test_and_set(id, tty_active_pairs);
if (pty_get_flags(lfd, major, index, &info))
goto out;
......
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