diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-09-13 16:15:46 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-09-13 16:15:46 +0000 |
commit | f7de4c0808f05a86ba0924caab062da18fb7a62e (patch) | |
tree | c81b1dcea794fdc60b2e800d4960ae0aa4afce7d | |
parent | 5abe9334aa6285784cc860385d6ae956d5f1a5d9 (diff) | |
download | nuttx-f7de4c0808f05a86ba0924caab062da18fb7a62e.tar.gz nuttx-f7de4c0808f05a86ba0924caab062da18fb7a62e.tar.bz2 nuttx-f7de4c0808f05a86ba0924caab062da18fb7a62e.zip |
cosmetic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2045 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r-- | nuttx/drivers/pipe.c | 6 | ||||
-rw-r--r-- | nuttx/drivers/pipe_common.c | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/nuttx/drivers/pipe.c b/nuttx/drivers/pipe.c index f51b4db2f..4b052e40f 100644 --- a/nuttx/drivers/pipe.c +++ b/nuttx/drivers/pipe.c @@ -1,7 +1,7 @@ /**************************************************************************** * drivers/pipe.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -99,6 +99,7 @@ static uint32 g_pipecreated = 0; /**************************************************************************** * Name: pipe_allocate ****************************************************************************/ + static inline int pipe_allocate(void) { int pipeno; @@ -119,6 +120,7 @@ static inline int pipe_allocate(void) /**************************************************************************** * Name: pipe_free ****************************************************************************/ + static inline void pipe_free(int pipeno) { int ret = sem_wait(&g_pipesem); @@ -132,6 +134,7 @@ static inline void pipe_free(int pipeno) /**************************************************************************** * Name: pipe_close ****************************************************************************/ + static int pipe_close(FAR struct file *filep) { struct inode *inode = filep->f_inode; @@ -179,6 +182,7 @@ static int pipe_close(FAR struct file *filep) * appropriately. * ****************************************************************************/ + int pipe(int filedes[2]) { struct pipe_dev_s *dev = NULL; diff --git a/nuttx/drivers/pipe_common.c b/nuttx/drivers/pipe_common.c index 7bfddb7db..82a822374 100644 --- a/nuttx/drivers/pipe_common.c +++ b/nuttx/drivers/pipe_common.c @@ -38,8 +38,8 @@ ****************************************************************************/ #include <nuttx/config.h> - #include <sys/types.h> + #include <sys/stat.h> #include <stdlib.h> #include <string.h> @@ -206,6 +206,7 @@ int pipecommon_open(FAR struct file *filep) /* If this this is the first writer, then the read semaphore indicates the * number of readers waiting for the first writer. Wake them all up. */ + if (dev->d_nwriters == 1) { while (sem_getvalue(&dev->d_rdsem, &sval) == 0 && sval < 0) |