Unverified Commit 74363c78 by Christian Brauner Committed by Stéphane Graber

conf: close fd in lxc_setup_devpts()

This left the file descriptor to the underlying /dev/ptmx file open which confused the hell out of criu. Let's close it. Closes https://github.com/lxc/lxd/issues/3243. Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 814e9e3a
...@@ -1369,10 +1369,11 @@ static int lxc_setup_devpts(int num_pts) ...@@ -1369,10 +1369,11 @@ static int lxc_setup_devpts(int num_pts)
SYSERROR("failed to create dummy \"/dev/ptmx\" file as bind mount target"); SYSERROR("failed to create dummy \"/dev/ptmx\" file as bind mount target");
return -1; return -1;
} }
close(ret);
DEBUG("created dummy \"/dev/ptmx\" file as bind mount target"); DEBUG("created dummy \"/dev/ptmx\" file as bind mount target");
/* Fallback option: create symlink /dev/ptmx -> /dev/pts/ptmx */ /* Fallback option: create symlink /dev/ptmx -> /dev/pts/ptmx */
ret = mount("/dev/pts/ptmx", "/dev/ptmx", "none", MS_BIND, 0); ret = mount("/dev/pts/ptmx", "/dev/ptmx", NULL, MS_BIND, NULL);
if (!ret) { if (!ret) {
DEBUG("bind mounted \"/dev/pts/ptmx\" to \"/dev/ptmx\""); DEBUG("bind mounted \"/dev/pts/ptmx\" to \"/dev/ptmx\"");
return 0; return 0;
......
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