2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-09-01 06:45:35 +00:00

tty: Brush up ctl tty preparation

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov
2012-09-12 20:09:05 +04:00
parent 1838bee1be
commit ccce9fed2a
2 changed files with 12 additions and 6 deletions

View File

@@ -135,11 +135,9 @@ static int prepare_shared(void)
if (ret < 0) if (ret < 0)
break; break;
if (pi->ctl_tty_id) { ret = prepare_ctl_tty(pi->pid.virt, pi->rst, pi->ctl_tty_id);
ret = prepare_ctl_tty(pi->pid.virt, pi->rst, pi->ctl_tty_id); if (ret < 0)
if (ret < 0) break;
break;
}
} }
mark_pipe_master(); mark_pipe_master();

10
files.c
View File

@@ -198,9 +198,17 @@ static int collect_fd(int pid, FdinfoEntry *e, struct rst_info *rst_info)
int prepare_ctl_tty(int pid, struct rst_info *rst_info, u32 ctl_tty_id) int prepare_ctl_tty(int pid, struct rst_info *rst_info, u32 ctl_tty_id)
{ {
FdinfoEntry *e = xmalloc(sizeof(*e)); FdinfoEntry *e;
if (!ctl_tty_id)
return 0;
pr_info("Requesting for ctl tty %#x into service fd\n", ctl_tty_id);
e = xmalloc(sizeof(*e));
if (!e) if (!e)
return -1; return -1;
fdinfo_entry__init(e); fdinfo_entry__init(e);
e->id = ctl_tty_id; e->id = ctl_tty_id;