[CRIU] [PATCH] tty: Assing special indeces for ext and serial ttys

Cyrill Gorcunov gorcunov at openvz.org
Wed Aug 31 01:20:28 PDT 2016


They are zero and may clash one day.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 criu/tty.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/criu/tty.c b/criu/tty.c
index 2cda4f1d5627..7705c5ffac5c 100644
--- a/criu/tty.c
+++ b/criu/tty.c
@@ -142,6 +142,8 @@ static LIST_HEAD(all_ttys);
 #define CONSOLE_INDEX	1002
 #define VT_INDEX	1004
 #define CTTY_INDEX	1006
+#define ETTY_INDEX	1008
+#define STTY_INDEX	1010
 #define INDEX_ERR	(MAX_TTYS + 1)
 
 static DECLARE_BITMAP(tty_bitmap, (MAX_TTYS << 1));
@@ -220,12 +222,14 @@ static int open_ext_tty(struct tty_info *info);
 static struct tty_driver ext_driver = {
 	.type			= TTY_TYPE__EXT_TTY,
 	.name			= "ext",
+	.index			= ETTY_INDEX,
 	.open			= open_ext_tty,
 };
 
 static struct tty_driver serial_driver = {
 	.type			= TTY_TYPE__SERIAL,
 	.name			= "serial",
+	.index			= STTY_INDEX,
 	.open			= open_simple_tty,
 };
 
-- 
2.7.4



More information about the CRIU mailing list