diff --git a/components/libc/compilers/dlib/syscall_remove.c b/components/libc/compilers/dlib/syscall_remove.c index e7f0268b1b..f7e64d1997 100644 --- a/components/libc/compilers/dlib/syscall_remove.c +++ b/components/libc/compilers/dlib/syscall_remove.c @@ -9,16 +9,16 @@ */ #include #ifdef RT_USING_DFS -#include +#include #endif #include #pragma module_name = "?remove" int remove(const char *val) { -#ifdef RT_USING_DFS - dfs_file_unlink(val); +#ifndef RT_USING_DFS + return -1; +#else + return unlink(val); #endif - - return 0; } diff --git a/components/libc/compilers/newlib/syscalls.c b/components/libc/compilers/newlib/syscalls.c index ae8b51b672..cf98e0c3ec 100644 --- a/components/libc/compilers/newlib/syscalls.c +++ b/components/libc/compilers/newlib/syscalls.c @@ -197,12 +197,9 @@ int _unlink_r(struct _reent *ptr, const char *file) { #ifndef RT_USING_DFS - return 0; + return -1; #else - int rc; - - rc = unlink(file); - return rc; + return unlink(file); #endif }