[3/7] files: Provide virt_sid in fd_parms

Submitted by Cyrill Gorcunov on Feb. 15, 2018, 8:30 p.m.

Details

Message ID 20180215203030.7513-4-gorcunov@virtuozzo.com
State New
Series "criu: Add support for ctty inheritance"
Headers show

Commit Message

Cyrill Gorcunov Feb. 15, 2018, 8:30 p.m.
Need it to distinguish current console instances.

Signed-off-by: Cyrill Gorcunov <gorcunov@virtuozzo.com>
---
 criu/files.c         | 1 +
 criu/include/files.h | 1 +
 2 files changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/criu/files.c b/criu/files.c
index d5b523f56..2d5d1bc89 100644
--- a/criu/files.c
+++ b/criu/files.c
@@ -344,6 +344,7 @@  static int fill_fd_params(struct pid *owner_pid, int fd, int lfd,
 	p->flags	= fdinfo.flags;
 	p->mnt_id	= fdinfo.mnt_id;
 	p->pid		= owner_pid->real;
+	p->virt_sid	= owner_pid->item ? owner_pid->item->sid : 0;
 	p->fd_flags	= opts->flags;
 
 	fown_entry__init(&p->fown);
diff --git a/criu/include/files.h b/criu/include/files.h
index 18a96da64..2b0b8af6d 100644
--- a/criu/include/files.h
+++ b/criu/include/files.h
@@ -45,6 +45,7 @@  struct fd_parms {
 	char		fd_flags;
 	struct stat	stat;
 	pid_t		pid;
+	pid_t		virt_sid;
 	FownEntry	fown;
 	struct fd_link	*link;
 	long		fs_type;