[libc][iar][gcc] 优化remove函数
@@ -9,16 +9,16 @@
*/
#include <rtthread.h>
#ifdef RT_USING_DFS
-#include <dfs_file.h>
+#include <dfs_posix.h>
#endif
#include <yfuns.h>
#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);
-
- return 0;
}
@@ -197,12 +197,9 @@ int
_unlink_r(struct _reent *ptr, const char *file)
#ifndef RT_USING_DFS
#else
- int rc;
- rc = unlink(file);
- return rc;
+ return unlink(file);