diff --git a/cr-restore.c b/cr-restore.c index f6c99add7..4fbf3abda 100644 --- a/cr-restore.c +++ b/cr-restore.c @@ -135,11 +135,9 @@ static int prepare_shared(void) if (ret < 0) break; - if (pi->ctl_tty_id) { - ret = prepare_ctl_tty(pi->pid.virt, pi->rst, pi->ctl_tty_id); - if (ret < 0) - break; - } + ret = prepare_ctl_tty(pi->pid.virt, pi->rst, pi->ctl_tty_id); + if (ret < 0) + break; } mark_pipe_master(); diff --git a/files.c b/files.c index ebc45696e..705af0a48 100644 --- a/files.c +++ b/files.c @@ -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) { - 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) return -1; + fdinfo_entry__init(e); e->id = ctl_tty_id;