summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nuttx/TODO17
-rw-r--r--nuttx/drivers/pipe.c8
2 files changed, 16 insertions, 9 deletions
diff --git a/nuttx/TODO b/nuttx/TODO
index 915c74310..bc9187550 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/)
- (4) File system/Generic drivers (fs/, drivers/)
+ (5) File system/Generic drivers (fs/, drivers/)
(1) Pascal add-on (pcode/)
(2) Documentation (Documentation/)
(3) Build system
@@ -221,7 +221,7 @@ o Libraries (lib/)
o File system / Generic drivers (fs/, drivers/)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- Description: Add chmod(), truncate().
+ Description: Implement chmod(), truncate().
Status: Open
Priority: Low
@@ -235,10 +235,19 @@ o File system / Generic drivers (fs/, drivers/)
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
+ and cannot be unlinked. This is actually a more generic
+ issue: unlink does not work for anything in the psuedo-
+ filesystem.
+ Status: Open, but partially resolved: pipe buffer is at least freed
+ when there are not open references to the pipe/FIFO.
Priority: Medium
+ Desccripton: dup and dup2 need to call into driver. Most drivers
+ will maintain internal open counts. dup and dup2 logically
+ increase the open count but do not interact with the driver
+ Status: Open
+ Priority: Medium
+
o Pascal Add-On (pcode/)
^^^^^^^^^^^^^^^^^^^^^^
diff --git a/nuttx/drivers/pipe.c b/nuttx/drivers/pipe.c
index 8c06974b1..5e0b2f6e5 100644
--- a/nuttx/drivers/pipe.c
+++ b/nuttx/drivers/pipe.c
@@ -133,7 +133,6 @@ static int pipe_close(FAR struct file *filep)
{
struct inode *inode = filep->f_inode;
struct pipe_dev_s *dev = inode->i_private;
- ubyte pipeno;
int ret;
/* Some sanity checking */
@@ -143,16 +142,15 @@ static int pipe_close(FAR struct file *filep)
return -EBADF;
}
#endif
- pipeno = dev->d_pipeno;
/* Perform common close operations */
ret = pipecommon_close(filep);
- if (ret == 0 && !inode->i_private)
+ if (ret == 0 && dev->d_refs == 0)
{
- /* Release the pipe */
+ /* Release the pipe when there are no further open references to it. */
- pipe_free(pipeno);
+ pipe_free(dev->d_pipeno);
}
return ret;
}