diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-04-30 23:24:48 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-04-30 23:24:48 +0000 |
commit | e17d3eedc63a01896b7bf8ed9a592748f61246ce (patch) | |
tree | 95db2ca7d0e801393f5103b594dde00ce16b5c51 /apps/examples/nxffs | |
parent | ae75e8e30f141aef342c6ce14fbb81ebeb359dbf (diff) | |
download | nuttx-e17d3eedc63a01896b7bf8ed9a592748f61246ce.tar.gz nuttx-e17d3eedc63a01896b7bf8ed9a592748f61246ce.tar.bz2 nuttx-e17d3eedc63a01896b7bf8ed9a592748f61246ce.zip |
Misc NXFFS bug fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3545 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/examples/nxffs')
-rw-r--r-- | apps/examples/nxffs/nxffs_main.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/apps/examples/nxffs/nxffs_main.c b/apps/examples/nxffs/nxffs_main.c index 9a3532e2c..bef334aa4 100644 --- a/apps/examples/nxffs/nxffs_main.c +++ b/apps/examples/nxffs/nxffs_main.c @@ -172,7 +172,7 @@ static inline void nxffs_randname(FAR struct nxffs_filedesc_s *file) if (!file->name) { fprintf(stderr, "ERROR: Failed to allocate name, length=%d\n", namelen); - exit(3); + exit(5); } memcpy(file->name, g_mountdir, dirlen); @@ -335,13 +335,19 @@ int user_start(int argc, char *argv[]) exit(3); } - /* Then write a file to the NXFFS file system */ + /* Then write a files to the NXFFS file system until either (1) all of the + * open file structures are utilized or until (2) NXFFS reports an error + * (hopefully that the file system is full) + */ - ret = nxffs_wrfile(); - if (ret < 0) + for (;;) { - fprintf(stderr, "ERROR: Failed to write a file\n"); - exit(3); + ret = nxffs_wrfile(); + if (ret < 0) + { + fprintf(stderr, "ERROR: Failed to write a file\n"); + exit(4); + } } return 0; |