提交 8ccfaa8e 编写于 作者: B bernard.xiong

cleanup DFS_USING_WORKDIR code.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1152 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 90ce1ad2
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#include <dfs_config.h> #include <dfs_config.h>
#include <dfs_file.h> #include <dfs_file.h>
#define NO_WORKING_DIR "system does not support working dir\n"
/* Global variables */ /* Global variables */
const struct dfs_filesystem_operation* filesystem_operation_table[DFS_FILESYSTEM_TYPES_MAX]; const struct dfs_filesystem_operation* filesystem_operation_table[DFS_FILESYSTEM_TYPES_MAX];
struct dfs_filesystem filesystem_table[DFS_FILESYSTEMS_MAX]; struct dfs_filesystem filesystem_table[DFS_FILESYSTEMS_MAX];
...@@ -273,6 +275,7 @@ char* dfs_normalize_path(const char* directory, const char* filename) ...@@ -273,6 +275,7 @@ char* dfs_normalize_path(const char* directory, const char* filename)
#else #else
if ((directory == NULL) && (filename[0] != '/')) if ((directory == NULL) && (filename[0] != '/'))
{ {
rt_kprintf(NO_WORKING_DIR);
return RT_NULL; return RT_NULL;
} }
#endif #endif
......
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
#include <dfs.h> #include <dfs.h>
#include <dfs_file.h> #include <dfs_file.h>
#define NO_WORKING_DIR "system does not support working dir\n"
/** /**
* @addtogroup FileApi * @addtogroup FileApi
*/ */
...@@ -43,7 +41,6 @@ int dfs_file_open(struct dfs_fd* fd, const char *path, int flags) ...@@ -43,7 +41,6 @@ int dfs_file_open(struct dfs_fd* fd, const char *path, int flags)
fullpath = dfs_normalize_path(RT_NULL, path); fullpath = dfs_normalize_path(RT_NULL, path);
if (fullpath == RT_NULL) if (fullpath == RT_NULL)
{ {
rt_kprintf(NO_WORKING_DIR);
return -1; return -1;
} }
...@@ -213,7 +210,6 @@ int dfs_file_unlink(const char *path) ...@@ -213,7 +210,6 @@ int dfs_file_unlink(const char *path)
fullpath = dfs_normalize_path(RT_NULL, path); fullpath = dfs_normalize_path(RT_NULL, path);
if ( fullpath == RT_NULL) if ( fullpath == RT_NULL)
{ {
rt_kprintf(NO_WORKING_DIR);
return -DFS_STATUS_EINVAL; return -DFS_STATUS_EINVAL;
} }
...@@ -327,7 +323,6 @@ int dfs_file_stat(const char *path, struct stat *buf) ...@@ -327,7 +323,6 @@ int dfs_file_stat(const char *path, struct stat *buf)
fullpath = dfs_normalize_path(RT_NULL, path); fullpath = dfs_normalize_path(RT_NULL, path);
if ( fullpath == RT_NULL ) if ( fullpath == RT_NULL )
{ {
rt_kprintf(NO_WORKING_DIR);
return -1; return -1;
} }
...@@ -395,7 +390,6 @@ int dfs_file_rename(const char* oldpath, const char* newpath) ...@@ -395,7 +390,6 @@ int dfs_file_rename(const char* oldpath, const char* newpath)
oldfullpath = dfs_normalize_path(RT_NULL, oldpath); oldfullpath = dfs_normalize_path(RT_NULL, oldpath);
if ( oldfullpath == RT_NULL ) if ( oldfullpath == RT_NULL )
{ {
rt_kprintf(NO_WORKING_DIR);
result = -DFS_STATUS_ENOENT; result = -DFS_STATUS_ENOENT;
goto __exit; goto __exit;
} }
...@@ -403,7 +397,6 @@ int dfs_file_rename(const char* oldpath, const char* newpath) ...@@ -403,7 +397,6 @@ int dfs_file_rename(const char* oldpath, const char* newpath)
newfullpath = dfs_normalize_path(RT_NULL, newpath); newfullpath = dfs_normalize_path(RT_NULL, newpath);
if ( newfullpath == RT_NULL ) if ( newfullpath == RT_NULL )
{ {
rt_kprintf(NO_WORKING_DIR);
result = -DFS_STATUS_ENOENT; result = -DFS_STATUS_ENOENT;
goto __exit; goto __exit;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册