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

zdtm: Add /dev/tty into construct_root and prepare_mntns

We will need it for tty testing.
Based-on-patch-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 243e58f0
......@@ -480,6 +480,9 @@ construct_root()
done
done
mkdir $root/dev
mknod -m 0666 $root/dev/tty c 5 0
# make 'tmp' dir under new root
mkdir -p $tmpdir
chmod 0777 $tmpdir
......
......@@ -122,6 +122,14 @@ static int prepare_mntns()
return -1;
}
}
if (access("/dev/tty", F_OK)) {
if (mknod("/dev/tty", 0666 | S_IFCHR, makedev(5, 0)) == 0) {
chmod("/dev/tty", 0666);
} else if (errno != EEXIST) {
fprintf(stderr, "mknod(/dev/tty) failed: %m\n");
return -1;
}
}
if (fchdir(dfd)) {
fprintf(stderr, "fchdir() failed: %m\n");
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