Commit a9c72414 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

tty: Fix path inversion for /dev/pts/ptmx

Need to compare the /pts/ part in the
former path, otherwise it will produce
bogus /dev/pts/pts/index form.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent fb54345e
......@@ -332,7 +332,7 @@ static struct reg_file_info *pty_alloc_fake_reg(struct tty_info *info, int type)
if (type == TTY_TYPE_PTM)
strcat(inverted_path, "ptmx");
else {
if (slash_at >= 4 && strcmp(&inverted_path[slash_at - 4], "pts"))
if (slash_at >= 3 && strncmp(&inverted_path[slash_at - 3], "pts", 3))
snprintf(&inverted_path[slash_at + 1], 10, "pts/%u",
info->tie->pty->index);
else
......
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