mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-22 01:55:24 +08:00
[dfs] add re-initial check.
This commit is contained in:
parent
000fe93b9f
commit
f3fc141f5f
@ -55,8 +55,16 @@ static int fd_alloc(struct dfs_fdtable *fdt, int startfd);
|
|||||||
/**
|
/**
|
||||||
* this function will initialize device file system.
|
* this function will initialize device file system.
|
||||||
*/
|
*/
|
||||||
|
static volatile uint8_t init_ok = 0;
|
||||||
int dfs_init(void)
|
int dfs_init(void)
|
||||||
{
|
{
|
||||||
|
if(init_ok)
|
||||||
|
{
|
||||||
|
rt_kprintf("dfs already init.\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
init_ok = 1;
|
||||||
|
|
||||||
/* clear filesystem operations table */
|
/* clear filesystem operations table */
|
||||||
memset((void *)filesystem_operation_table, 0, sizeof(filesystem_operation_table));
|
memset((void *)filesystem_operation_table, 0, sizeof(filesystem_operation_table));
|
||||||
/* clear filesystem table */
|
/* clear filesystem table */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user