提交 2a57ba9f 编写于 作者: S shaojinchun

统一getcwd和chdir的加锁方式

上级 fc6bc1ad
...@@ -890,9 +890,9 @@ int access(const char *path, int amode) ...@@ -890,9 +890,9 @@ int access(const char *path, int amode)
char *getcwd(char *buf, size_t size) char *getcwd(char *buf, size_t size)
{ {
#ifdef DFS_USING_WORKDIR #ifdef DFS_USING_WORKDIR
rt_enter_critical(); dfs_lock();
strncpy(buf, working_directory, size); strncpy(buf, working_directory, size);
rt_exit_critical(); dfs_unlock();
#else #else
rt_kprintf(NO_WORKING_DIR); rt_kprintf(NO_WORKING_DIR);
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册