统一getcwd和chdir的加锁方式
This commit is contained in:
parent
fc6bc1ad39
commit
2a57ba9f96
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue