2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-09-01 06:45:35 +00:00

restore: reserve the service descriptor for a control tty

I'm really lucky.

prepare_ctl_tty:
	e->fd           = get_service_fd(CTL_TTY_OFF); // -1 as fd is not set

send_fd_to_self:
if (dup2(fd, dfd) != dfd) { // tries to install sfd, but -1 == -1

tty_restore_ctl_terminal:
	if (!is_service_fd(fd, CTL_TTY_OFF))
		return fd == get_service_fd(type); // -1 = -1

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrey Vagin
2013-03-18 23:04:09 +04:00
committed by Pavel Emelyanov
parent a9ac1b29b4
commit bce89dba4b
3 changed files with 12 additions and 1 deletions

View File

@@ -132,6 +132,7 @@ enum sfd_type {
extern int clone_service_fd(int id);
extern int init_service_fd(void);
extern int get_service_fd(enum sfd_type type);
extern int reserve_service_fd(enum sfd_type type);
extern int install_service_fd(enum sfd_type type, int fd);
extern int close_service_fd(enum sfd_type type);
extern bool is_service_fd(int fd, enum sfd_type type);