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