diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2007-07-05 18:01:52 +0200 |
---|---|---|
committer | Sascha Hauer <sha@octopus.labnet.pengutronix.de> | 2007-07-05 18:01:52 +0200 |
commit | e694adc6a4716fc589693eb8eb8e67bbf54e8edc (patch) | |
tree | f8af4d37d05c8f628ecc3abbe8c8d48a43794482 /fs/ramfs.c | |
parent | 2692aaeb76f66cc8fe2f1196697d9a75b06c4522 (diff) | |
download | barebox-e694adc6a4716fc589693eb8eb8e67bbf54e8edc.tar.gz barebox-e694adc6a4716fc589693eb8eb8e67bbf54e8edc.tar.xz |
svn_rev_420
- do more POSIX:
- use DIR instead of struct dirent
- use (struct dirent)->d_name instead of (struct dirent)->name
- switch to a new layout for U_BOOT_CMD:
- use C99 initializers to be able to add more fields to the
command struct
- add aliases for commands (needed mainly for help -> ? and test -> [
- This is not done for all commands yet, but the compiler will tell you ;)
Diffstat (limited to 'fs/ramfs.c')
-rw-r--r-- | fs/ramfs.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/ramfs.c b/fs/ramfs.c index 5047d7c399..d0b60bd20e 100644 --- a/fs/ramfs.c +++ b/fs/ramfs.c @@ -426,9 +426,9 @@ int ramfs_truncate(struct device_d *dev, FILE *f, ulong size) return 0; } -struct dir* ramfs_opendir(struct device_d *dev, const char *pathname) +DIR* ramfs_opendir(struct device_d *dev, const char *pathname) { - struct dir *dir; + DIR *dir; struct ramfs_priv *priv = dev->priv; struct ramfs_inode *node; // printf("opendir: %s\n", pathname); @@ -441,26 +441,26 @@ struct dir* ramfs_opendir(struct device_d *dev, const char *pathname) if (node->mode != S_IFDIR) return NULL; - dir = xmalloc(sizeof(struct dir)); + dir = xmalloc(sizeof(DIR)); dir->priv = node->child; return dir; } -struct dirent* ramfs_readdir(struct device_d *dev, struct dir *dir) +struct dirent* ramfs_readdir(struct device_d *dev, DIR *dir) { struct ramfs_inode *node = dir->priv; if (node) { - strcpy(dir->d.name, node->name); + strcpy(dir->d.d_name, node->name); dir->priv = node->next; return &dir->d; } return NULL; } -int ramfs_closedir(struct device_d *dev, struct dir *dir) +int ramfs_closedir(struct device_d *dev, DIR *dir) { free(dir); return 0; |