diff options
| author | [email protected] <[email protected]> | 2011-02-22 00:14:23 +0000 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2011-02-22 00:14:23 +0000 |
| commit | ead014f966417d9f00d66b2062ec23c157ca3f42 (patch) | |
| tree | e1592a4badd91a4f0afd8d92fc98b704b884f40d | |
| parent | 54228a051852005210ec03e079119bd350376fac (diff) | |
update mkromfs script.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1287 bbd45198-f89e-11dd-88c7-29a3b14d5316
| -rw-r--r-- | components/dfs/filesystems/romfs/dfs_romfs.c | 10 | ||||
| -rw-r--r-- | components/dfs/filesystems/romfs/mkromfs.py | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/components/dfs/filesystems/romfs/dfs_romfs.c b/components/dfs/filesystems/romfs/dfs_romfs.c index 934d1dd859..123299ee51 100644 --- a/components/dfs/filesystems/romfs/dfs_romfs.c +++ b/components/dfs/filesystems/romfs/dfs_romfs.c @@ -165,11 +165,11 @@ int dfs_romfs_stat(struct dfs_filesystem* fs, const char *path, struct stat *st) if (dirent == RT_NULL) return -DFS_STATUS_ENOENT;
st->st_dev = 0;
- st->st_mode = DFS_S_IFREG | DFS_S_IRUSR | DFS_S_IRGRP | DFS_S_IROTH | - DFS_S_IWUSR | DFS_S_IWGRP | DFS_S_IWOTH; + st->st_mode = DFS_S_IFREG | DFS_S_IRUSR | DFS_S_IRGRP | DFS_S_IROTH |
+ DFS_S_IWUSR | DFS_S_IWGRP | DFS_S_IWOTH;
if (dirent->type == ROMFS_DIRENT_DIR)
- { + {
st->st_mode &= ~DFS_S_IFREG;
st->st_mode |= DFS_S_IFDIR | DFS_S_IXUSR | DFS_S_IXGRP | DFS_S_IXOTH;
}
@@ -202,7 +202,7 @@ int dfs_romfs_getdents(struct dfs_fd* file, struct dirent* dirp, rt_uint32_t cou for (index = 0; index < count && file->pos < file->size; index ++)
{
d = dirp + index;
- +
sub_dirent = &dirent[file->pos];
name = sub_dirent->name;
@@ -212,7 +212,7 @@ int dfs_romfs_getdents(struct dfs_fd* file, struct dirent* dirp, rt_uint32_t cou else
d->d_type = DFS_DT_REG;
- d->d_namlen = rt_strlen(name); + d->d_namlen = rt_strlen(name);
d->d_reclen = (rt_uint16_t)sizeof(struct dirent);
rt_strncpy(d->d_name, name, rt_strlen(name) + 1);
diff --git a/components/dfs/filesystems/romfs/mkromfs.py b/components/dfs/filesystems/romfs/mkromfs.py index ebda107b76..e0ed938dc1 100644 --- a/components/dfs/filesystems/romfs/mkromfs.py +++ b/components/dfs/filesystems/romfs/mkromfs.py @@ -85,7 +85,7 @@ def mkromfs_dir(dirname, is_root = False): if not os.path.isfile(fullpath):
l = os.listdir(fullpath)
if len(l):
- mkromfs_output(('\t{ROMFS_DIRENT_DIR, "%s", %s, sizeof(%s)/sizeof(%s[0])},\n' % (fn, item_name, item_name, item_name)))
+ mkromfs_output(('\t{ROMFS_DIRENT_DIR, "%s", (rt_uint8_t*) %s, sizeof(%s)/sizeof(%s[0])},\n' % (fn, item_name, item_name, item_name)))
else:
mkromfs_output(('\t{ROMFS_DIRENT_DIR, "%s", RT_NULL, 0},\n' % fn))
@@ -122,4 +122,4 @@ if __name__ == "__main__": mkromfs_output("#include <dfs_romfs.h>\n\n")
mkromfs_dir(basename, is_root = True)
- mkromfs_output("const struct romfs_dirent romfs_root = {ROMFS_DIRENT_DIR, \"/\", _root_dirent, sizeof(_root_dirent)/sizeof(_root_dirent[0])};\n\n")
+ mkromfs_output("const struct romfs_dirent romfs_root = {ROMFS_DIRENT_DIR, \"/\", (rt_uint8_t*) _root_dirent, sizeof(_root_dirent)/sizeof(_root_dirent[0])};\n\n")
|
