summaryrefslogtreecommitdiff
path: root/components/dfs/src
diff options
context:
space:
mode:
authorarmink <[email protected]>2019-01-02 16:49:57 +0800
committerarmink <[email protected]>2019-01-02 16:49:57 +0800
commit1805aadbbbb60854164508f25728c91d71785f27 (patch)
treec9c2470af61ddd9f761a8b8741295abad11386b1 /components/dfs/src
parentebc14b09d5c1ccf61a7bf2e70d410dbadb087322 (diff)
[component] Sync to latest version.
Diffstat (limited to 'components/dfs/src')
-rw-r--r--components/dfs/src/dfs.c2
-rw-r--r--components/dfs/src/dfs_posix.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/components/dfs/src/dfs.c b/components/dfs/src/dfs.c
index 38a1813421..cf0b2b0ef9 100644
--- a/components/dfs/src/dfs.c
+++ b/components/dfs/src/dfs.c
@@ -221,7 +221,7 @@ struct dfs_fd *fd_get(int fd)
d = fdt->fds[fd];
/* check dfs_fd valid or not */
- if (d->magic != DFS_FD_MAGIC)
+ if ((d == NULL) || (d->magic != DFS_FD_MAGIC))
{
dfs_unlock();
return NULL;
diff --git a/components/dfs/src/dfs_posix.c b/components/dfs/src/dfs_posix.c
index 97531ad59c..f47a60ee5d 100644
--- a/components/dfs/src/dfs_posix.c
+++ b/components/dfs/src/dfs_posix.c
@@ -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