summaryrefslogtreecommitdiff
path: root/nuttx/examples/ostest/dev_null.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-03-01 21:05:55 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-03-01 21:05:55 +0000
commit08680a039b6ffc922731d9a1cfdff20ef204dbba (patch)
tree25bb704377c624f2d63c4bb5ad1df332d44aa78a /nuttx/examples/ostest/dev_null.c
parent129dd27cc4deb042d2f88c65927adc49c338756d (diff)
downloadpx4-nuttx-08680a039b6ffc922731d9a1cfdff20ef204dbba.tar.gz
px4-nuttx-08680a039b6ffc922731d9a1cfdff20ef204dbba.tar.bz2
px4-nuttx-08680a039b6ffc922731d9a1cfdff20ef204dbba.zip
This creates a 8051 build that can run in 24Kb of RAM
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@26 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/examples/ostest/dev_null.c')
-rw-r--r--nuttx/examples/ostest/dev_null.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/nuttx/examples/ostest/dev_null.c b/nuttx/examples/ostest/dev_null.c
index f9ca5623a..28b4287fd 100644
--- a/nuttx/examples/ostest/dev_null.c
+++ b/nuttx/examples/ostest/dev_null.c
@@ -50,7 +50,9 @@
* Private Data
************************************************************/
-static char buffer[1024];
+#if CONFIG_NFILE_DESCRIPTORS > 0
+
+static FAR char buffer[1024];
/************************************************************
* Public Functions
@@ -64,14 +66,14 @@ int dev_null(void)
fd = open("/dev/null", O_RDWR);
if (fd < 0)
{
- fprintf(stderr, "dev_null: Failed to open /dev/null\n");
+ printf("dev_null: ERROR Failed to open /dev/null\n");
return -1;
}
nbytes = read(fd, buffer, 1024);
if (nbytes < 0)
{
- fprintf(stderr, "dev_null: Failed to read from /dev/null\n");
+ printf("dev_null: ERROR Failed to read from /dev/null\n");
close(fd);
return -1;
}
@@ -80,7 +82,7 @@ int dev_null(void)
nbytes = write(fd, buffer, 1024);
if (nbytes < 0)
{
- fprintf(stderr, "dev_null: Failed to write to /dev/null\n");
+ printf("dev_null: ERROR Failed to write to /dev/null\n");
close(fd);
return -1;
}
@@ -89,3 +91,5 @@ int dev_null(void)
close(fd);
return 0;
}
+
+#endif /*CONFIG_NFILE_DESCRIPTORS */