From: Christian Brauner Date: Wed, 4 Jul 2018 12:54:15 +0000 (+0200) Subject: conf: use mknod() to create dummy mount target X-Git-Tag: lxc-3.1.0~219^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6947153da5c6251a567b06c42ff054fd2d22c963;p=thirdparty%2Flxc.git conf: use mknod() to create dummy mount target Signed-off-by: Christian Brauner --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 0f02e400c..48a5c7b6d 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -892,13 +892,11 @@ static int lxc_setup_ttys(struct lxc_conf *conf) if (ret < 0 || (size_t)ret >= sizeof(lxcpath)) return -1; - ret = creat(lxcpath, 0660); + ret = mknod(path, S_IFREG, 0); if (ret < 0 && errno != EEXIST) { SYSERROR("Failed to create \"%s\"", lxcpath); return -1; } - if (ret >= 0) - close(ret); ret = unlink(path); if (ret < 0 && errno != ENOENT) {