From 8468ddf520c7a4f3722a18f6ee9d858d50165b88 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 13 Sep 2009 16:15:46 +0000 Subject: [PATCH] cosmetic git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2045 42af7a65-404d-4744-a932-0658087f49c3 --- drivers/pipe.c | 6 +++++- drivers/pipe_common.c | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/pipe.c b/drivers/pipe.c index f51b4db2f1..4b052e40f5 100644 --- a/drivers/pipe.c +++ b/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 * * 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/drivers/pipe_common.c b/drivers/pipe_common.c index 7bfddb7dbd..82a822374d 100644 --- a/drivers/pipe_common.c +++ b/drivers/pipe_common.c @@ -38,8 +38,8 @@ ****************************************************************************/ #include - #include + #include #include #include @@ -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)