summaryrefslogtreecommitdiff
path: root/components/dfs/src
diff options
context:
space:
mode:
authoraozima <[email protected]>2018-07-02 16:57:19 +0800
committeraozima <[email protected]>2018-07-02 16:58:49 +0800
commitf3fc141f5f9a99a0f1bb7cd731ee4410b43f32f8 (patch)
treee6775d538753334299fcfe0a2e639dc19a3ac959 /components/dfs/src
parent000fe93b9f416be3d08805b71b8d1eb51b9818fe (diff)
[dfs] add re-initial check.
Diffstat (limited to 'components/dfs/src')
-rw-r--r--components/dfs/src/dfs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/components/dfs/src/dfs.c b/components/dfs/src/dfs.c
index fbc0899d36..459ab52793 100644
--- a/components/dfs/src/dfs.c
+++ b/components/dfs/src/dfs.c
@@ -55,8 +55,16 @@ static int fd_alloc(struct dfs_fdtable *fdt, int startfd);
/**
* this function will initialize device file system.
*/
+static volatile uint8_t init_ok = 0;
int dfs_init(void)
{
+ if(init_ok)
+ {
+ rt_kprintf("dfs already init.\n");
+ return 0;
+ }
+ init_ok = 1;
+
/* clear filesystem operations table */
memset((void *)filesystem_operation_table, 0, sizeof(filesystem_operation_table));
/* clear filesystem table */