summaryrefslogtreecommitdiff
path: root/components/dfs/src
diff options
context:
space:
mode:
authorMurphyZhao <[email protected]>2019-01-05 12:00:22 +0800
committerMurphyZhao <[email protected]>2019-01-05 14:20:44 +0800
commit5d6c7e0df709c1cde63ce8b21870525706e52ed9 (patch)
tree46dd7aff964f4226fca4aa9c05f8b805bbba0b11 /components/dfs/src
parent366e28f47682f76b3f6df85c3dcbd9785a01fa39 (diff)
[components][dfs] Refix #2100 PR
#2100 PR 增加 `#include <libc.h>` 后,如果定义了 `RT_USING_DFS_DEVFS`,那就必须要开启 LIBC 才可以成功编译,增加了对 RT_USING_LIBC 的依赖。但是,这个修复又是关于开启 POSIX 的时候遇到的问题,因此建议在引入 <libc.h> 的地方,加入对 `RT_USING_POSIX` 的依赖。 Signed-off-by: MurphyZhao <[email protected]>
Diffstat (limited to 'components/dfs/src')
-rw-r--r--components/dfs/src/dfs.c4
1 files 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 <lwp.h>
#endif
-#ifdef RT_USING_DFS_DEVFS
+#if defined(RT_USING_DFS_DEVFS) && defined(RT_USING_POSIX)
#include <libc.h>
#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