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/devfs.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/devfs.c')
-rw-r--r-- | fs/devfs.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/devfs.c b/fs/devfs.c index 3716aaeb2d..6510664140 100644 --- a/fs/devfs.c +++ b/fs/devfs.c @@ -36,11 +36,11 @@ static int devfs_close(struct device_d *dev, FILE *f) return 0; } -struct dir* devfs_opendir(struct device_d *dev, const char *pathname) +DIR* devfs_opendir(struct device_d *dev, const char *pathname) { - struct dir *dir; + DIR *dir; - dir = malloc(sizeof(struct dir)); + dir = malloc(sizeof(DIR)); if (!dir) return NULL; @@ -49,7 +49,7 @@ struct dir* devfs_opendir(struct device_d *dev, const char *pathname) return dir; } -struct dirent* devfs_readdir(struct device_d *_dev, struct dir *dir) +struct dirent* devfs_readdir(struct device_d *_dev, DIR *dir) { struct device_d *dev = dir->priv; @@ -57,14 +57,14 @@ struct dirent* devfs_readdir(struct device_d *_dev, struct dir *dir) dev = dev->next; if (dev) { - strcpy(dir->d.name, dev->id); + strcpy(dir->d.d_name, dev->id); dir->priv = dev->next; return &dir->d; } return NULL; } -int devfs_closedir(struct device_d *dev, struct dir *dir) +int devfs_closedir(struct device_d *dev, DIR *dir) { free(dir); return 0; |