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

zdtm: Mount devpts in new root

In case if we enter the new rootfs don't forget to
mount devpts, otherwise ttys can't be connected.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Acked-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 0ee1eed5
...@@ -58,6 +58,18 @@ static int prepare_mntns() ...@@ -58,6 +58,18 @@ static int prepare_mntns()
fprintf(stderr, "mount(/proc) failed: %m\n"); fprintf(stderr, "mount(/proc) failed: %m\n");
return -1; return -1;
} }
if (mkdir("/dev", 0755) && errno != EEXIST) {
fprintf(stderr, "mkdir(/dev) failed: %m\n");
return -1;
}
if (mkdir("/dev/pts", 0755) && errno != EEXIST) {
fprintf(stderr, "mkdir(/dev/pts) failed: %m\n");
return -1;
}
if (mount("pts", "/dev/pts", "devpts", MS_MGC_VAL, NULL)) {
fprintf(stderr, "mount(/dev/pts) failed: %m\n");
return -1;
}
if (fchdir(dfd)) { if (fchdir(dfd)) {
fprintf(stderr, "fchdir() failed: %m\n"); fprintf(stderr, "fchdir() failed: %m\n");
return -1; return -1;
......
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