From: Christian Brauner Date: Wed, 3 Feb 2021 09:04:59 +0000 (+0100) Subject: conf: remove unnecessary syscall X-Git-Tag: lxc-5.0.0~303^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdf7314dc4104f7422c7a5f3db3f571e04e6bf8c;p=thirdparty%2Flxc.git conf: remove unnecessary syscall Signed-off-by: Christian Brauner --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 97b601e01..99707bdc6 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -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\"");