diff options
| author | bernard.xiong <[email protected]> | 2010-02-01 13:14:01 +0000 |
|---|---|---|
| committer | bernard.xiong <[email protected]> | 2010-02-01 13:14:01 +0000 |
| commit | d2590bb99a2fe9b1587653fd369c1fcef4eabd7d (patch) | |
| tree | a2b052a4ac2bceb96d0477a82a6a83bda1292712 /filesystem/dfs | |
| parent | 82e7844cbf41844a84b2b8528c76eb79f387fe44 (diff) | |
add DFS_O_TRUNC option to ELM FatFs interface layer.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@358 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'filesystem/dfs')
| -rw-r--r-- | filesystem/dfs/filesystems/efsl/src/fs/vfat/include/fs.h | 2 | ||||
| -rw-r--r-- | filesystem/dfs/filesystems/elmfat/dfs_elm.c | 1 | ||||
| -rw-r--r-- | filesystem/dfs/include/dfs_posix.h | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/filesystem/dfs/filesystems/efsl/src/fs/vfat/include/fs.h b/filesystem/dfs/filesystems/efsl/src/fs/vfat/include/fs.h index 5779ffd5f1..5c9207192b 100644 --- a/filesystem/dfs/filesystems/efsl/src/fs/vfat/include/fs.h +++ b/filesystem/dfs/filesystems/efsl/src/fs/vfat/include/fs.h @@ -108,7 +108,7 @@ struct _FileSystem{ }; typedef struct _FileSystem FileSystem; -/**************************************************************************************************\ +/**************************************************************************************************\ FileLocation ---------- * euint32 Sector Sector where the directoryentry of the file/directory can be found. diff --git a/filesystem/dfs/filesystems/elmfat/dfs_elm.c b/filesystem/dfs/filesystems/elmfat/dfs_elm.c index 654536a5d8..4f5604bc7a 100644 --- a/filesystem/dfs/filesystems/elmfat/dfs_elm.c +++ b/filesystem/dfs/filesystems/elmfat/dfs_elm.c @@ -142,6 +142,7 @@ int dfs_elm_open(struct dfs_fd* file) if (file->flags & DFS_O_CREAT) mode |= FA_CREATE_NEW;
if (file->flags & DFS_O_WRONLY) mode |= FA_WRITE;
+ if (file->flags & DFS_O_TRUNC) mode |= FA_CREATE_ALWAYS;
/* allocate a fd */
fd = (FIL*)rt_malloc(sizeof(FIL));
diff --git a/filesystem/dfs/include/dfs_posix.h b/filesystem/dfs/include/dfs_posix.h index 79682b3bb7..b39ab2cb3e 100644 --- a/filesystem/dfs/include/dfs_posix.h +++ b/filesystem/dfs/include/dfs_posix.h @@ -28,7 +28,7 @@ #define O_DIRECTORY DFS_O_DIRECTORY
#define S_IFMT DFS_S_IFMT
-#define S_IFSOCK DFS_S_IFSOCK
+#define S_IFSOCK DFS_S_IFSOCK
#define S_IFLNK DFS_S_IFLNK
#define S_IFREG DFS_S_IFREG
#define S_IFBLK DFS_S_IFBLK
|
