summaryrefslogtreecommitdiff
path: root/components/libc/compilers/dlib/syscall_open.c
diff options
context:
space:
mode:
authorguo <[email protected]>2021-10-27 12:22:35 +0800
committerGitHub <[email protected]>2021-10-27 12:22:35 +0800
commit4d256eb308f4e9f7abc1644dda3fd675e560d518 (patch)
tree4da0b0458ca8749c4fcee2ede8681304641ba89d /components/libc/compilers/dlib/syscall_open.c
parent31bf735d2159995358315036be1529523ac96d7d (diff)
parenta9910a780edc43df6b64bcd13c37785a15ec3428 (diff)
Merge pull request #5228 from mysterywolf/posix
Diffstat (limited to 'components/libc/compilers/dlib/syscall_open.c')
-rw-r--r--components/libc/compilers/dlib/syscall_open.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/components/libc/compilers/dlib/syscall_open.c b/components/libc/compilers/dlib/syscall_open.c
index 37bfcecb47..891b9afe58 100644
--- a/components/libc/compilers/dlib/syscall_open.c
+++ b/components/libc/compilers/dlib/syscall_open.c
@@ -10,17 +10,13 @@
#include <rtthread.h>
#include <yfuns.h>
-#ifdef RT_USING_DFS
-#include <dfs_posix.h>
-#endif
+#include <fcntl.h>
#pragma module_name = "?__open"
int __open(const char *filename, int mode)
{
-#ifndef RT_USING_DFS
- return _LLIO_ERROR;
-#else
+#ifdef RT_LIBC_USING_FILEIO
int handle;
int open_mode = O_RDONLY;
@@ -70,5 +66,7 @@ int __open(const char *filename, int mode)
return _LLIO_ERROR;
return handle;
-#endif
+#else
+ return _LLIO_ERROR;
+#endif /* RT_LIBC_USING_FILEIO */
}