From abcb05060332b83dfa5cd7d41f7c1ca15665a1f1 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Mon, 15 Feb 2021 07:53:58 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[libc][iar][gcc]=20=E4=BC=98=E5=8C=96remove?= =?UTF-8?q?=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/libc/compilers/dlib/syscall_remove.c | 8 ++++---- components/libc/compilers/newlib/syscalls.c | 7 ++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/components/libc/compilers/dlib/syscall_remove.c b/components/libc/compilers/dlib/syscall_remove.c index e7f0268b1b..ca949a5bc1 100644 --- a/components/libc/compilers/dlib/syscall_remove.c +++ b/components/libc/compilers/dlib/syscall_remove.c @@ -16,9 +16,9 @@ #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(filename); #endif - - return 0; } diff --git a/components/libc/compilers/newlib/syscalls.c b/components/libc/compilers/newlib/syscalls.c index 193080c926..f7dd922e1b 100644 --- a/components/libc/compilers/newlib/syscalls.c +++ b/components/libc/compilers/newlib/syscalls.c @@ -196,12 +196,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 } From 540bacad9cfcb444378ae9dda6318d9aaf1b0176 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Mon, 15 Feb 2021 08:03:52 +0800 Subject: [PATCH 2/3] update --- components/libc/compilers/dlib/syscall_remove.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/libc/compilers/dlib/syscall_remove.c b/components/libc/compilers/dlib/syscall_remove.c index ca949a5bc1..477955d0e1 100644 --- a/components/libc/compilers/dlib/syscall_remove.c +++ b/components/libc/compilers/dlib/syscall_remove.c @@ -19,6 +19,6 @@ int remove(const char *val) #ifndef RT_USING_DFS return -1; #else - return unlink(filename); + return unlink(val); #endif } From c842f2a067a04ceb5ba3ba414110db058c92c1f5 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Mon, 15 Feb 2021 08:05:49 +0800 Subject: [PATCH 3/3] change header --- components/libc/compilers/dlib/syscall_remove.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/libc/compilers/dlib/syscall_remove.c b/components/libc/compilers/dlib/syscall_remove.c index 477955d0e1..f7e64d1997 100644 --- a/components/libc/compilers/dlib/syscall_remove.c +++ b/components/libc/compilers/dlib/syscall_remove.c @@ -9,7 +9,7 @@ */ #include #ifdef RT_USING_DFS -#include +#include #endif #include