From 2521b18e3dbb7c284e1e92450a868051dc7d2c6b Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 26 Jul 2008 20:47:39 +0000 Subject: Fix counting error git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@785 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/TODO | 8 +++++++- nuttx/drivers/pipe-common.c | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/nuttx/TODO b/nuttx/TODO index 89f406389..915c74310 100644 --- a/nuttx/TODO +++ b/nuttx/TODO @@ -10,7 +10,7 @@ NuttX TODO List (Last updated February 13, 2008) (11) Network (net/, netutils/) (2) USB (drivers/usbdev) (3) Libraries (lib/) - (3) File system/Generic drivers (fs/, drivers/) + (4) File system/Generic drivers (fs/, drivers/) (1) Pascal add-on (pcode/) (2) Documentation (Documentation/) (3) Build system @@ -233,6 +233,12 @@ o File system / Generic drivers (fs/, drivers/) Status: Open Priority: Medium + Description: There is no way to remove a FIFO or PIPE created in the + psuedo filesystem. Once created, they persist indefinitely + and cannot be unlinked. + Status: Open + Priority: Medium + o Pascal Add-On (pcode/) ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/nuttx/drivers/pipe-common.c b/nuttx/drivers/pipe-common.c index f25ef010e..98e8ee0e6 100644 --- a/nuttx/drivers/pipe-common.c +++ b/nuttx/drivers/pipe-common.c @@ -221,9 +221,9 @@ int pipecommon_close(FAR struct file *filep) pipecommon_semtake(&dev->s.d_bfsem); - /* Check if the decremented reference count would be zero */ + /* Check if the decremented reference count would be less than zero */ - if (dev->s.d_refs > 1) + if (dev->s.d_refs > 0) { /* No.. then just decrement the reference count */ -- cgit v1.2.3