summaryrefslogtreecommitdiff
path: root/nuttx/examples/mount/mount_main.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-05-14 11:12:09 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-05-14 11:12:09 +0000
commita75eeec47f39797429d5cae90db057374aeeac5d (patch)
tree103d013eb38e421a6a94b36c445dfaff31183962 /nuttx/examples/mount/mount_main.c
parentce1b502f81ef5c420f4d6d9fd68c31a1627cac55 (diff)
downloadpx4-nuttx-a75eeec47f39797429d5cae90db057374aeeac5d.tar.gz
px4-nuttx-a75eeec47f39797429d5cae90db057374aeeac5d.tar.bz2
px4-nuttx-a75eeec47f39797429d5cae90db057374aeeac5d.zip
umount and fat fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@227 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/examples/mount/mount_main.c')
-rw-r--r--nuttx/examples/mount/mount_main.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/nuttx/examples/mount/mount_main.c b/nuttx/examples/mount/mount_main.c
index 541530d6b..3ba8f96d5 100644
--- a/nuttx/examples/mount/mount_main.c
+++ b/nuttx/examples/mount/mount_main.c
@@ -108,10 +108,21 @@ int user_start(int argc, char *argv[])
}
else
{
+ char buffer[128];
+ int nbytes = read(fd, buffer, 128);
+ if (nbytes < 0)
+ {
+ printf("main: failed to read from %s, errno=%d\n", g_testfile1, *get_errno_ptr());
+ }
+ else
+ {
+ buffer[127]='\0';
+ printf("main: Read \"%s\" from %s\n", buffer, g_testfile1);
+ }
close(fd);
}
- printf("main: opening %s for reading\n", g_testfile2);
+ printf("main: opening %s for writing\n", g_testfile2);
fd = open(g_testfile2, O_WRONLY|O_CREAT|O_TRUNC, 0644);
if (fd < 0)