]> git.proxmox.com Git - mirror_lxc.git/commitdiff
conf: use mknod() to create dummy mount target
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 4 Jul 2018 12:54:15 +0000 (14:54 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 4 Jul 2018 16:21:37 +0000 (18:21 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/conf.c

index 0f02e400c568d7eaeff2ddcad386ad79054b880a..48a5c7b6dcc1a5b73793911b3e5749b6fba77887 100644 (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) {