未验证 提交 d1cb9c5d 编写于 作者: B Bernard Xiong 提交者: GitHub

Merge pull request #4341 from mysterywolf/unlink

[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);
#endif
return 0;
}
......@@ -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
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册