[CRIU] [PATCH 08/11] tty: Carry @minor in tty_info and tty_dump_info
Cyrill Gorcunov
gorcunov at openvz.org
Mon Sep 29 09:25:34 PDT 2014
We will need them to properly recognize the type
of tty when printing their type and on verification.
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
tty.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tty.c b/tty.c
index 07cab3e5abaf..13b313718f8b 100644
--- a/tty.c
+++ b/tty.c
@@ -84,6 +84,7 @@ struct tty_info {
struct list_head sibling;
int major;
+ int minor;
bool create;
bool inherit;
@@ -97,6 +98,7 @@ struct tty_dump_info {
pid_t pgrp;
int fd;
int major;
+ int minor;
};
static LIST_HEAD(all_tty_info_entries);
@@ -977,6 +979,7 @@ static int collect_one_tty(void *obj, ProtobufCMessage *msg)
INIT_LIST_HEAD(&info->sibling);
info->major = major(info->tie->rdev);
+ info->minor = minor(info->tie->rdev);
info->create = (info->major == TTYAUX_MAJOR);
info->inherit = false;
@@ -1059,7 +1062,7 @@ int dump_verify_tty_sids(void)
return ret;
}
-static int dump_pty_info(int lfd, u32 id, const struct fd_parms *p, int major, int index)
+static int dump_pty_info(int lfd, u32 id, const struct fd_parms *p, int major, int minor, int index)
{
TtyInfoEntry info = TTY_INFO_ENTRY__INIT;
TermiosEntry termios = TERMIOS_ENTRY__INIT;
@@ -1095,6 +1098,7 @@ static int dump_pty_info(int lfd, u32 id, const struct fd_parms *p, int major, i
dinfo->pgrp = pti->pgrp;
dinfo->fd = p->fd;
dinfo->major = major;
+ dinfo->minor = minor;
list_add_tail(&dinfo->list, &all_ttys);
@@ -1204,7 +1208,7 @@ static int dump_one_pty(int lfd, u32 id, const struct fd_parms *p, int major, in
*/
if (!tty_test_and_set(e.tty_info_id, tty_bitmap))
- ret = dump_pty_info(lfd, e.tty_info_id, p, major, index);
+ ret = dump_pty_info(lfd, e.tty_info_id, p, major, minor, index);
if (!ret)
ret = pb_write_one(fdset_fd(glob_fdset, CR_FD_TTY_FILES), &e, PB_TTY_FILE);
--
1.9.3
More information about the CRIU
mailing list