[05/18] tty: Prepare for no parasite_ctl

Submitted by Pavel Emelyanov on July 10, 2017, 9:38 a.m.

Details

Message ID 6fe3f32d-0f42-de3c-7b0f-674492aa1fc4@virtuozzo.com
State Accepted
Series "Support descriptors sent over unix sockets"
Headers show

Commit Message

Pavel Emelyanov July 10, 2017, 9:38 a.m.
SCM-dumping code won't provide the ctl for TTY dump. To
make this work we'll have to peek required tty info from
current (see the SCM patch), but I doubt that anyone
sends TTYs via sockets ... so keep this in TODO list.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
---
 criu/tty.c | 5 +++++
 1 file changed, 5 insertions(+)

Patch hide | download patch | download mbox

diff --git a/criu/tty.c b/criu/tty.c
index f674f25..a967ee3 100644
--- a/criu/tty.c
+++ b/criu/tty.c
@@ -1764,6 +1764,11 @@  static int dump_tty_info(int lfd, u32 id, const struct fd_parms *p, struct tty_d
 
 	int ret = -1;
 
+	if (!p->fd_ctl) {
+		pr_err("No CTL for TTY dump, likely SCM case\n");
+		return -1;
+	}
+
 	/*
 	 * Make sure the structures the system provides us
 	 * correlates well with protobuf templates.