Added redirection test

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@790 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2008-07-30 00:29:11 +00:00
parent 1c9cadf1c3
commit 378b050ffa
5 changed files with 331 additions and 158 deletions
+1 -1
View File
@@ -38,7 +38,7 @@
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = pipe_main.c transfer_test.c interlock_test.c
CSRCS = pipe_main.c transfer_test.c interlock_test.c redirect_test.c
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
+12 -3
View File
@@ -97,7 +97,10 @@ static void *null_writer(pthread_addr_t pvarg)
/* Then close the FIFO */
printf("null_writer: Closing %s\n", FIFO_PATH2);
close(fd);
if (close(fd) != 0)
{
fprintf(stderr, "null_writer: close failed: %d\n", errno);
}
sleep(5);
printf("null_writer: Returning success\n");
@@ -177,7 +180,10 @@ int interlock_test(void)
/* Close the file */
printf("interlock_test: Closing %s\n", FIFO_PATH2);
close(fd);
if (close(fd) != 0)
{
fprintf(stderr, "interlock_test: close failed: %d\n", errno);
}
/* Wait for null_writer thread to complete */
@@ -204,7 +210,10 @@ int interlock_test(void)
return 0;
errout_with_file:
close(fd);
if (close(fd) != 0)
{
fprintf(stderr, "interlock_test: close failed: %d\n", errno);
}
errout_with_thread:
pthread_detach(writerid);
pthread_cancel(writerid);
+5
View File
@@ -51,6 +51,10 @@
#define FIFO_PATH1 "/tmp/testfifo-1"
#define FIFO_PATH2 "/tmp/testfifo-2"
#ifndef CONFIG_EXAMPLES_PIPE_STACKSIZE
# define CONFIG_EXAMPLES_PIPE_STACKSIZE 1024
#endif
/****************************************************************************
* Public Types
****************************************************************************/
@@ -65,5 +69,6 @@
extern int transfer_test(int fdin, int fdout);
extern int interlock_test(void);
extern int redirection_test(void);
#endif /* __EXAMPLES_PIPE_PIPE_H */
+39 -154
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff