统一getcwd和chdir的加锁方式

This commit is contained in:
shaojinchun 2018-11-22 18:21:45 +08:00
parent fc6bc1ad39
commit 2a57ba9f96
1 changed files with 2 additions and 2 deletions

View File

@ -890,9 +890,9 @@ int access(const char *path, int amode)
char *getcwd(char *buf, size_t size)
{
#ifdef DFS_USING_WORKDIR
rt_enter_critical();
dfs_lock();
strncpy(buf, working_directory, size);
rt_exit_critical();
dfs_unlock();
#else
rt_kprintf(NO_WORKING_DIR);
#endif