From: Christian Brauner Date: Fri, 28 Apr 2017 11:52:43 +0000 (+0200) Subject: conf: close fd in lxc_setup_devpts() X-Git-Tag: lxc-2.1.0~148^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1528%2Fhead;p=thirdparty%2Flxc.git 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: Christian Brauner --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index fc7fb183c..eb92b5cd4 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -1428,10 +1428,11 @@ static int lxc_setup_devpts(int num_pts) SYSERROR("failed to create dummy \"/dev/ptmx\" file as bind mount target"); return -1; } + close(ret); DEBUG("created dummy \"/dev/ptmx\" file as bind mount target"); /* 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) { DEBUG("bind mounted \"/dev/pts/ptmx\" to \"/dev/ptmx\""); return 0;