cleanup DFS_USING_WORKDIR code.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1152 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
bernard.xiong 2010-11-30 05:36:25 +00:00
parent 90ce1ad219
commit 8ccfaa8eb7
2 changed files with 3 additions and 7 deletions

View File

@ -18,6 +18,8 @@
#include <dfs_config.h>
#include <dfs_file.h>
#define NO_WORKING_DIR "system does not support working dir\n"
/* Global variables */
const struct dfs_filesystem_operation* filesystem_operation_table[DFS_FILESYSTEM_TYPES_MAX];
struct dfs_filesystem filesystem_table[DFS_FILESYSTEMS_MAX];
@ -273,6 +275,7 @@ char* dfs_normalize_path(const char* directory, const char* filename)
#else
if ((directory == NULL) && (filename[0] != '/'))
{
rt_kprintf(NO_WORKING_DIR);
return RT_NULL;
}
#endif

View File

@ -14,8 +14,6 @@
#include <dfs.h>
#include <dfs_file.h>
#define NO_WORKING_DIR "system does not support working dir\n"
/**
* @addtogroup FileApi
*/
@ -43,7 +41,6 @@ int dfs_file_open(struct dfs_fd* fd, const char *path, int flags)
fullpath = dfs_normalize_path(RT_NULL, path);
if (fullpath == RT_NULL)
{
rt_kprintf(NO_WORKING_DIR);
return -1;
}
@ -213,7 +210,6 @@ int dfs_file_unlink(const char *path)
fullpath = dfs_normalize_path(RT_NULL, path);
if ( fullpath == RT_NULL)
{
rt_kprintf(NO_WORKING_DIR);
return -DFS_STATUS_EINVAL;
}
@ -327,7 +323,6 @@ int dfs_file_stat(const char *path, struct stat *buf)
fullpath = dfs_normalize_path(RT_NULL, path);
if ( fullpath == RT_NULL )
{
rt_kprintf(NO_WORKING_DIR);
return -1;
}
@ -395,7 +390,6 @@ int dfs_file_rename(const char* oldpath, const char* newpath)
oldfullpath = dfs_normalize_path(RT_NULL, oldpath);
if ( oldfullpath == RT_NULL )
{
rt_kprintf(NO_WORKING_DIR);
result = -DFS_STATUS_ENOENT;
goto __exit;
}
@ -403,7 +397,6 @@ int dfs_file_rename(const char* oldpath, const char* newpath)
newfullpath = dfs_normalize_path(RT_NULL, newpath);
if ( newfullpath == RT_NULL )
{
rt_kprintf(NO_WORKING_DIR);
result = -DFS_STATUS_ENOENT;
goto __exit;
}