From 5d6c7e0df709c1cde63ce8b21870525706e52ed9 Mon Sep 17 00:00:00 2001 From: MurphyZhao Date: Sat, 5 Jan 2019 12:00:22 +0800 Subject: [PATCH] [components][dfs] Refix #2100 PR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #2100 PR 增加 `#include ` 后,如果定义了 `RT_USING_DFS_DEVFS`,那就必须要开启 LIBC 才可以成功编译,增加了对 RT_USING_LIBC 的依赖。但是,这个修复又是关于开启 POSIX 的时候遇到的问题,因此建议在引入 的地方,加入对 `RT_USING_POSIX` 的依赖。 Signed-off-by: MurphyZhao --- components/dfs/src/dfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/dfs/src/dfs.c b/components/dfs/src/dfs.c index 12ae8e9d95..1850ac426c 100644 --- a/components/dfs/src/dfs.c +++ b/components/dfs/src/dfs.c @@ -18,7 +18,7 @@ #include #endif -#ifdef RT_USING_DFS_DEVFS +#if defined(RT_USING_DFS_DEVFS) && defined(RT_USING_POSIX) #include #endif @@ -216,7 +216,7 @@ struct dfs_fd *fd_get(int fd) struct dfs_fd *d; struct dfs_fdtable *fdt; -#ifdef RT_USING_DFS_DEVFS +#if defined(RT_USING_DFS_DEVFS) && defined(RT_USING_POSIX) if ((0 <= fd) && (fd <= 2)) fd = libc_stdio_get_console(); #endif