summaryrefslogtreecommitdiffstats
path: root/fs/fs.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2007-07-05 18:01:52 +0200
committerSascha Hauer <sha@octopus.labnet.pengutronix.de>2007-07-05 18:01:52 +0200
commite694adc6a4716fc589693eb8eb8e67bbf54e8edc (patch)
treef8af4d37d05c8f628ecc3abbe8c8d48a43794482 /fs/fs.c
parent2692aaeb76f66cc8fe2f1196697d9a75b06c4522 (diff)
downloadbarebox-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/fs.c')
-rw-r--r--fs/fs.c12
1 files changed, 6 insertions, 6 deletions
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);
}