From e694adc6a4716fc589693eb8eb8e67bbf54e8edc Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Thu, 5 Jul 2007 18:01:52 +0200 Subject: 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 ;) --- fs/fs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'fs/fs.c') diff --git a/fs/fs.c b/fs/fs.c index 0dd2f07491..1d56c863f6 100644 --- a/fs/fs.c +++ b/fs/fs.c @@ -188,7 +188,7 @@ static struct device_d *get_device_by_path(char **path) int dir_is_empty(const char *pathname) { - struct dir *dir; + DIR *dir; struct dirent *d; int ret = 1; @@ -199,7 +199,7 @@ int dir_is_empty(const char *pathname) } while ((d = readdir(dir))) { - if (!strcmp(d->name, ".") || !strcmp(d->name, "..")) + if (!strcmp(d->d_name, ".") || !strcmp(d->d_name, "..")) continue; ret = 0; break; @@ -575,9 +575,9 @@ int umount(const char *pathname) return 0; } -struct dir *opendir(const char *pathname) +DIR *opendir(const char *pathname) { - struct dir *dir = NULL; + DIR *dir = NULL; struct device_d *dev; struct fs_driver_d *fsdrv; char *p = normalise_path(pathname); @@ -604,12 +604,12 @@ out: return dir; } -struct dirent *readdir(struct dir *dir) +struct dirent *readdir(DIR *dir) { return dir->fsdrv->readdir(dir->dev, dir); } -int closedir(struct dir *dir) +int closedir(DIR *dir) { return dir->fsdrv->closedir(dir->dev, dir); } -- cgit v1.2.3