From 63b05a8c73dfb1d842a31fbeb2688941ddde704a Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Sun, 25 Feb 2018 21:00:07 +0800 Subject: [PATCH] [libc]: fix the open issue when DFS disabled. --- components/libc/newlib/syscalls.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/libc/newlib/syscalls.c b/components/libc/newlib/syscalls.c index 13c6a1cce..4dcf53422 100644 --- a/components/libc/newlib/syscalls.c +++ b/components/libc/newlib/syscalls.c @@ -465,6 +465,8 @@ void abort(void) int libc_console_init(void) { +#ifdef RT_USING_DFS + /* open console as stdin/stdout/stderr */ __console_fd = open("/dev/console", O_RDWR, 0); /* for stdin/stdout/stderr */ @@ -479,6 +481,7 @@ int libc_console_init(void) _GLOBAL_REENT->__sdidinit = 1; } +#endif return 0; } -- GitLab