[CRIU] [PATCH 4/5] tty: Set active-pairs bit once
Pavel Emelyanov
xemul at virtuozzo.com
Wed Jul 19 14:20:32 MSK 2017
Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
criu/tty.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/criu/tty.c b/criu/tty.c
index abeb483..0076348 100644
--- a/criu/tty.c
+++ b/criu/tty.c
@@ -1563,6 +1563,16 @@ static int collect_one_tty_info_entry(void *obj, ProtobufCMessage *msg, struct c
return -1;
}
+ /*
+ * The tty peers which have no @termios are hung up,
+ * so don't mark them as active, we create them with
+ * faked master and they are rather a rudiment which
+ * can't be used. Most likely they appear if a user has
+ * dumped program when it was closing a peer.
+ */
+ if (is_pty(driver) && tie->termios)
+ tty_test_and_set(tie->id, tty_active_pairs);
+
return 0;
}
@@ -1636,16 +1646,6 @@ static int tty_info_setup(struct tty_info *info)
}
}
- /*
- * The tty peers which have no @termios are hung up,
- * so don't mark them as active, we create them with
- * faked master and they are rather a rudiment which
- * can't be used. Most likely they appear if a user has
- * dumped program when it was closing a peer.
- */
- if (is_pty(info->driver) && info->tie->termios)
- tty_test_and_set(info->tfe->tty_info_id, tty_active_pairs);
-
pr_info("Collected tty ID %#x (%s)\n", info->tfe->id, info->driver->name);
add_post_prepare_cb_once(&prep_tty_restore);
--
2.1.4
More information about the CRIU
mailing list