]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
conf: remove unnecessary syscall
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 3 Feb 2021 09:04:59 +0000 (10:04 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 3 Feb 2021 10:49:51 +0000 (11:49 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/conf.c

index 97b601e015e96f48db487b2a4cfaec95fd282698..99707bdc6ac65f28362bc778fb45afd568a92622 100644 (file)
@@ -1154,13 +1154,13 @@ static int lxc_fill_autodev(const struct lxc_rootfs *rootfs)
        mode_t cmask;
        int use_mknod = LXC_DEVNODE_MKNOD;
 
-       /* ignore, just don't try to fill in */
-       if (!exists_dir_at(rootfs->mntpt_fd, "dev"))
-               return 0;
-
        dev_dir_fd = openat(rootfs->mntpt_fd, "dev/", O_RDONLY | O_CLOEXEC | O_DIRECTORY | O_PATH | O_NOFOLLOW);
-       if (dev_dir_fd < 0)
+       if (dev_dir_fd < 0) {
+               if (errno == ENOENT)
+                       return log_info(0, "No /dev directory found, skipping setup");
+
                return -errno;
+       }
 
        INFO("Populating \"/dev\"");