From a58593f784d4b84ce09f194c15bc79e20a80aa6a Mon Sep 17 00:00:00 2001 From: bernard Date: Wed, 25 Jun 2014 17:20:57 +0800 Subject: [PATCH] [libc] code cleanup. --- components/libc/armlibc/stubs.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/components/libc/armlibc/stubs.c b/components/libc/armlibc/stubs.c index 301f654182..d219b3430a 100644 --- a/components/libc/armlibc/stubs.c +++ b/components/libc/armlibc/stubs.c @@ -46,8 +46,10 @@ const char __stderr_name[] = "STDERR"; */ FILEHANDLE _sys_open(const char *name, int openmode) { +#ifdef RT_USING_DFS int fd; - +#endif + /* Register standard Input Output devices. */ if (strcmp(name, __stdin_name) == 0) return (STDIN); @@ -91,12 +93,13 @@ int _sys_close(FILEHANDLE fh) */ int _sys_read(FILEHANDLE fh, unsigned char *buf, unsigned len, int mode) { +#ifdef RT_USING_DFS int size; - +#endif + if (fh == STDIN) { /* TODO */ - return 0; } @@ -125,8 +128,10 @@ int _sys_read(FILEHANDLE fh, unsigned char *buf, unsigned len, int mode) */ int _sys_write(FILEHANDLE fh, const unsigned char *buf, unsigned len, int mode) { +#ifdef RT_USING_DFS int size; - +#endif + if ((fh == STDOUT) || (fh == STDERR)) { #ifndef RT_USING_CONSOLE -- GitLab