From 6947153da5c6251a567b06c42ff054fd2d22c963 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Wed, 4 Jul 2018 14:54:15 +0200 Subject: [PATCH] conf: use mknod() to create dummy mount target Signed-off-by: Christian Brauner --- src/lxc/conf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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) { -- 2.47.2