Commit 0105e543 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

tty: Dump a hanging up terminal

If we've met a hanging up terminal we can escape
lot of work but dump a minimum information needed
for restore.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 07aa6682
......@@ -806,16 +806,25 @@ static int dump_pty_info(int lfd, u32 id, const struct fd_parms *p, int major, i
info.sid = sid;
info.pgrp = pgrp;
info.rdev = p->stat.st_rdev;
info.termios = &termios;
info.termios_locked = &termios_locked;
info.winsize = &winsize;
info.pty = &pty;
pty.index = index;
/*
* Nothing we can do on hangin up terminal,
* just write out minimum information we can
* gather.
*/
if (hangup)
return pb_write_one(fdset_fd(glob_fdset, CR_FD_TTY_INFO), &info, PB_TTY_INFO);
if (pty_get_flags(lfd, major, index, &info))
goto out;
info.termios = &termios;
info.termios_locked = &termios_locked;
info.winsize = &winsize;
termios.n_c_cc = TERMIOS_NCC;
termios.c_cc = xmalloc(pb_repeated_size(&termios, c_cc));
......
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