2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 18:07:57 +00:00

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: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Cyrill Gorcunov 2012-09-14 17:50:44 +04:00 committed by Pavel Emelyanov
parent 07aa668282
commit 0105e543a7

15
tty.c
View File

@ -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));