summaryrefslogtreecommitdiff
path: root/apps/examples/pipe/pipe_main.c
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-09-28 16:50:07 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-09-28 16:50:07 -0600
commit4c24c7c4a741eaeffc76339f07076cdad7a36c56 (patch)
tree337a94000f0e849884e81e8ac2ee188bf0a38179 /apps/examples/pipe/pipe_main.c
parente735773fe5ea269b43dbecb246cec846b3a0368e (diff)
downloadnuttx-4c24c7c4a741eaeffc76339f07076cdad7a36c56.tar.gz
nuttx-4c24c7c4a741eaeffc76339f07076cdad7a36c56.tar.bz2
nuttx-4c24c7c4a741eaeffc76339f07076cdad7a36c56.zip
Clean up some naming: fd vs. fildes vs. filedes and filep vs filp
Diffstat (limited to 'apps/examples/pipe/pipe_main.c')
-rw-r--r--apps/examples/pipe/pipe_main.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/apps/examples/pipe/pipe_main.c b/apps/examples/pipe/pipe_main.c
index 63a4f283f..9ada9af5f 100644
--- a/apps/examples/pipe/pipe_main.c
+++ b/apps/examples/pipe/pipe_main.c
@@ -1,7 +1,7 @@
/****************************************************************************
* examples/pipe/pipe_main.c
*
- * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2011, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -74,7 +74,7 @@
int pipe_main(int argc, char *argv[])
{
- int filedes[2];
+ int fd[2];
int ret;
/* Test FIFO logic */
@@ -93,20 +93,20 @@ int pipe_main(int argc, char *argv[])
* only on open for read-only (see interlock_test()).
*/
- filedes[1] = open(FIFO_PATH1, O_WRONLY);
- if (filedes[1] < 0)
+ fd[1] = open(FIFO_PATH1, O_WRONLY);
+ if (fd[1] < 0)
{
fprintf(stderr, "pipe_main: Failed to open FIFO %s for writing, errno=%d\n",
FIFO_PATH1, errno);
return 2;
}
- filedes[0] = open(FIFO_PATH1, O_RDONLY);
- if (filedes[0] < 0)
+ fd[0] = open(FIFO_PATH1, O_RDONLY);
+ if (fd[0] < 0)
{
fprintf(stderr, "pipe_main: Failed to open FIFO %s for reading, errno=%d\n",
FIFO_PATH1, errno);
- if (close(filedes[1]) != 0)
+ if (close(fd[1]) != 0)
{
fprintf(stderr, "pipe_main: close failed: %d\n", errno);
}
@@ -115,12 +115,12 @@ int pipe_main(int argc, char *argv[])
/* Then perform the test using those file descriptors */
- ret = transfer_test(filedes[0], filedes[1]);
- if (close(filedes[0]) != 0)
+ ret = transfer_test(fd[0], fd[1]);
+ if (close(fd[0]) != 0)
{
fprintf(stderr, "pipe_main: close failed: %d\n", errno);
}
- if (close(filedes[1]) != 0)
+ if (close(fd[1]) != 0)
{
fprintf(stderr, "pipe_main: close failed: %d\n", errno);
}
@@ -136,7 +136,7 @@ int pipe_main(int argc, char *argv[])
/* Test PIPE logic */
printf("\npipe_main: Performing pipe test\n");
- ret = pipe(filedes);
+ ret = pipe(fd);
if (ret < 0)
{
fprintf(stderr, "pipe_main: pipe failed with errno=%d\n", errno);
@@ -145,12 +145,12 @@ int pipe_main(int argc, char *argv[])
/* Then perform the test using those file descriptors */
- ret = transfer_test(filedes[0], filedes[1]);
- if (close(filedes[0]) != 0)
+ ret = transfer_test(fd[0], fd[1]);
+ if (close(fd[0]) != 0)
{
fprintf(stderr, "pipe_main: close failed: %d\n", errno);
}
- if (close(filedes[1]) != 0)
+ if (close(fd[1]) != 0)
{
fprintf(stderr, "pipe_main: close failed: %d\n", errno);
}