From fdf7314dc4104f7422c7a5f3db3f571e04e6bf8c Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Wed, 3 Feb 2021 10:04:59 +0100 Subject: [PATCH] conf: remove unnecessary syscall Signed-off-by: Christian Brauner --- src/lxc/conf.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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\""); -- 2.47.2