Commit 7a8bee8a by Jean-Tiare LE BIGOT Committed by Stéphane Graber

Ensure /dev/pts directory exists on pts setup

When `lxc.autodev = 0` and empty tmpfs is mounted on /dev and private pts are requested, we need to ensure '/dev/pts' exists before attempting to mount devpts on it. Signed-off-by: 's avatarJean-Tiare LE BIGOT <jean-tiare.le-bigot@ovh.net> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent 7802d482
......@@ -1605,6 +1605,13 @@ static int setup_pts(int pts)
return -1;
}
if (mkdir("/dev/pts", 0755)) {
if ( errno != EEXIST ) {
SYSERROR("failed to create '/dev/pts'");
return -1;
}
}
if (mount("devpts", "/dev/pts", "devpts", MS_MGC_VAL,
"newinstance,ptmxmode=0666,mode=0620,gid=5")) {
SYSERROR("failed to mount a new instance of '/dev/pts'");
......
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