From 9fb4908710ea9ddca5fd7d6cdd4cf656e98b8bbb Mon Sep 17 00:00:00 2001 From: qiuyiuestc Date: Mon, 25 Jan 2010 16:44:49 +0000 Subject: support for mini2440 emulator git-svn-id: https://rt-thread.googlecode.com/svn/trunk@336 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- filesystem/dfs/filesystems/efsl/src/fs/vfat/ui.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'filesystem') diff --git a/filesystem/dfs/filesystems/efsl/src/fs/vfat/ui.c b/filesystem/dfs/filesystems/efsl/src/fs/vfat/ui.c index b37e0397e2..c8e1027219 100644 --- a/filesystem/dfs/filesystems/efsl/src/fs/vfat/ui.c +++ b/filesystem/dfs/filesystems/efsl/src/fs/vfat/ui.c @@ -35,7 +35,7 @@ /*****************************************************************************/ #include "ui.h" #include "ls.h" -#include "efs.h" +#include "efs.h" /*****************************************************************************/ /* **************************************************************************** @@ -65,12 +65,13 @@ esint16 un_link(FileSystem *fs,euint8* filename) firstCluster <<= 16; firstCluster += ex_getb16(buf+loc.Offset*32+26); attr = ex_getb16(buf+loc.Offset*32+11); + part_relSect(fs->part,buf); + if(attr == ATTR_DIRECTORY) { dlist = (DirList *)rt_malloc(sizeof(DirList)); if(dlist == RT_NULL) { - part_relSect(fs->part,buf); dfs_log(DFS_DEBUG_INFO, ("Memory alloc failed")); return -DFS_STATUS_ENOMEM; @@ -91,9 +92,7 @@ esint16 un_link(FileSystem *fs,euint8* filename) { /* '.' and '..' */ if(dlist->currentEntry.FileName[0] == '.') continue; - - part_relSect(fs->part,buf); - + dfs_log(DFS_DEBUG_INFO, ("Directory not empty")); return -DFS_STATUS_ENOTEMPTY; } @@ -101,7 +100,8 @@ esint16 un_link(FileSystem *fs,euint8* filename) } } } - + + buf = part_getSect(fs->part,loc.Sector,IOM_MODE_READWRITE); memClr(buf+(loc.Offset*32),32); part_relSect(fs->part,buf); cache.DiscCluster = cache.LastCluster = cache.Linear = cache.LogicCluster = 0; -- cgit v1.3.1