diff options
Diffstat (limited to 'nuttx/fs')
-rw-r--r-- | nuttx/fs/fat/fs_fat32.c | 6 | ||||
-rw-r--r-- | nuttx/fs/nxffs/nxffs_open.c | 2 | ||||
-rw-r--r-- | nuttx/fs/romfs/fs_romfs.c | 2 | ||||
-rw-r--r-- | nuttx/fs/smartfs/smartfs_procfs.c | 5 | ||||
-rw-r--r-- | nuttx/fs/smartfs/smartfs_smart.c | 4 | ||||
-rw-r--r-- | nuttx/fs/smartfs/smartfs_utils.c | 3 |
6 files changed, 9 insertions, 13 deletions
diff --git a/nuttx/fs/fat/fs_fat32.c b/nuttx/fs/fat/fs_fat32.c index c26d9ee61..a94352035 100644 --- a/nuttx/fs/fat/fs_fat32.c +++ b/nuttx/fs/fat/fs_fat32.c @@ -391,7 +391,7 @@ static int fat_close(FAR struct file *filep) struct inode *inode; struct fat_file_s *ff; struct fat_mountpt_s *fs; - int ret = OK; + int ret; /* Sanity checks */ @@ -1505,7 +1505,7 @@ static int fat_opendir(struct inode *mountpt, const char *relpath, struct fs_dir errout_with_semaphore: fat_semgive(fs); - return ERROR; + return ret; } /**************************************************************************** @@ -1523,7 +1523,7 @@ static int fat_readdir(struct inode *mountpt, struct fs_dirent_s *dir) uint8_t ch; uint8_t attribute; bool found; - int ret = OK; + int ret; /* Sanity checks */ diff --git a/nuttx/fs/nxffs/nxffs_open.c b/nuttx/fs/nxffs/nxffs_open.c index 72fb6a9f9..ff7d5372f 100644 --- a/nuttx/fs/nxffs/nxffs_open.c +++ b/nuttx/fs/nxffs/nxffs_open.c @@ -1132,7 +1132,7 @@ int nxffs_close(FAR struct file *filep) { FAR struct nxffs_volume_s *volume; FAR struct nxffs_ofile_s *ofile; - int ret = -ENOSYS; + int ret; fvdbg("Closing\n"); diff --git a/nuttx/fs/romfs/fs_romfs.c b/nuttx/fs/romfs/fs_romfs.c index 6a6fca355..e2999f364 100644 --- a/nuttx/fs/romfs/fs_romfs.c +++ b/nuttx/fs/romfs/fs_romfs.c @@ -745,7 +745,7 @@ static int romfs_opendir(FAR struct inode *mountpt, FAR const char *relpath, errout_with_semaphore: romfs_semgive(rm); - return ERROR; + return ret; } /**************************************************************************** diff --git a/nuttx/fs/smartfs/smartfs_procfs.c b/nuttx/fs/smartfs/smartfs_procfs.c index 64f7101d4..f1c75c365 100644 --- a/nuttx/fs/smartfs/smartfs_procfs.c +++ b/nuttx/fs/smartfs/smartfs_procfs.c @@ -435,14 +435,11 @@ static int smartfs_rewinddir(struct fs_dirent_s *dir) static int smartfs_stat(const char *relpath, struct stat *buf) { - int ret = -ENOENT; - /* TODO: Decide if the relpath is valid and if it is a file * or a directory and set it's permissions. */ buf->st_mode = S_IFDIR|S_IROTH|S_IRGRP|S_IRUSR; - ret = OK; /* File/directory size, access block size */ @@ -450,7 +447,7 @@ static int smartfs_stat(const char *relpath, struct stat *buf) buf->st_blksize = 0; buf->st_blocks = 0; - return ret; + return OK; } /**************************************************************************** diff --git a/nuttx/fs/smartfs/smartfs_smart.c b/nuttx/fs/smartfs/smartfs_smart.c index 7264b3f64..50018a443 100644 --- a/nuttx/fs/smartfs/smartfs_smart.c +++ b/nuttx/fs/smartfs/smartfs_smart.c @@ -192,7 +192,7 @@ static int smartfs_open(FAR struct file *filep, const char *relpath, sf = (struct smartfs_ofile_s *) kmalloc(sizeof *sf); if (sf == NULL) { - ret = ENOMEM; + ret = -ENOMEM; goto errout_with_semaphore; } @@ -213,7 +213,7 @@ static int smartfs_open(FAR struct file *filep, const char *relpath, { /* Can't open a dir as a file! */ - ret = EISDIR; + ret = -EISDIR; goto errout_with_buffer; } diff --git a/nuttx/fs/smartfs/smartfs_utils.c b/nuttx/fs/smartfs/smartfs_utils.c index 30813a44b..3c41ce524 100644 --- a/nuttx/fs/smartfs/smartfs_utils.c +++ b/nuttx/fs/smartfs/smartfs_utils.c @@ -854,11 +854,10 @@ int smartfs_createentry(struct smartfs_mountpt_s *fs, goto errout; } - nextsector = ret; + nextsector = (uint16_t) ret; /* Set the newly allocated sector's type (file or dir) */ - nextsector = (uint16_t) ret; if ((type & SMARTFS_DIRENT_TYPE) == SMARTFS_DIRENT_TYPE_DIR) { chainheader->type = SMARTFS_SECTOR_TYPE_DIR; |