Commit 4cb9eaf3 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

tty: Fix compilation warrning

 | tty.c: In function ‘tty_restore_ctl_terminal’:
 | include/criu-log.h:42:16: error: ‘index’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

Same time assign CONSOLE_INDEX for debug info.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 102cbe8a
......@@ -486,7 +486,7 @@ static int tty_restore_ctl_terminal(struct file_desc *d, int fd)
{
struct tty_info *info = container_of(d, struct tty_info, d);
struct reg_file_info *fake = NULL;
int slave = -1, ret = -1, index;
int slave = -1, ret = -1, index = -1;
if (!is_service_fd(fd, CTL_TTY_OFF))
return 0;
......@@ -503,7 +503,7 @@ static int tty_restore_ctl_terminal(struct file_desc *d, int fd)
}
} else if (info->type == TTY_TYPE_CONSOLE) {
slave = open_pty_reg(info->reg_d, O_RDONLY);
index = -1;
index = CONSOLE_INDEX;
if (slave < 0) {
pr_perror("Can't open %s", path_from_reg(info->reg_d));
goto err;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment