conf: use mknod() to create dummy mount target

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner 2018-07-04 14:54:15 +02:00
parent 77a3980598
commit 6947153da5
No known key found for this signature in database
GPG Key ID: 8EB056D53EECB12D

View File

@ -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) {