diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-01-17 14:43:55 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-01-17 14:43:55 +0000 |
commit | d8d9cc8a96cdc2219af7bec8142e7633779fd685 (patch) | |
tree | d9cf39f88361f174a2350d354ffb5584d43e2fc4 /nuttx/fs | |
parent | 4f0e8b1249c1550bac83f9db61c67094bc6afc2d (diff) | |
download | px4-nuttx-d8d9cc8a96cdc2219af7bec8142e7633779fd685.tar.gz px4-nuttx-d8d9cc8a96cdc2219af7bec8142e7633779fd685.tar.bz2 px4-nuttx-d8d9cc8a96cdc2219af7bec8142e7633779fd685.zip |
Add logic to automatically unload module on exit; Several patches from Mike Smith
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5528 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/fs')
-rw-r--r-- | nuttx/fs/binfs/fs_binfs.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/nuttx/fs/binfs/fs_binfs.c b/nuttx/fs/binfs/fs_binfs.c index ed6326eba..56ea472af 100644 --- a/nuttx/fs/binfs/fs_binfs.c +++ b/nuttx/fs/binfs/fs_binfs.c @@ -222,7 +222,7 @@ static int binfs_ioctl(FAR struct file *filep, int cmd, unsigned long arg) } else { - *ptr = g_builtins[(int)filep->f_priv].name; + *ptr = builtin_getname((int)filep->f_priv); ret = OK; } } @@ -287,13 +287,15 @@ static int binfs_opendir(struct inode *mountpt, const char *relpath, static int binfs_readdir(struct inode *mountpt, struct fs_dirent_s *dir) { + FAR const char *name; unsigned int index; int ret; /* Have we reached the end of the directory */ index = dir->u.binfs.fb_index; - if (g_builtins[index].name == NULL) + name = builtin_getname(index); + if (name == NULL) { /* We signal the end of the directory by returning the * special error -ENOENT @@ -306,9 +308,9 @@ static int binfs_readdir(struct inode *mountpt, struct fs_dirent_s *dir) { /* Save the filename and file type */ - fvdbg("Entry %d: \"%s\"\n", index, g_builtins[index].name); + fvdbg("Entry %d: \"%s\"\n", index, name); dir->fd_dir.d_type = DTYPE_FILE; - strncpy(dir->fd_dir.d_name, g_builtins[index].name, NAME_MAX+1); + strncpy(dir->fd_dir.d_name, name, NAME_MAX+1); /* The application list is terminated by an entry with a NULL name. * Therefore, there is at least one more entry in the list. |