summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-07-30 00:28:43 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-07-30 00:28:43 +0000
commit18161f32055969218532f2174e577e4b888b29f1 (patch)
treed09a15526764f119af45f338b01535f5e6d2d627 /nuttx
parent35d2ad28792ad668adc504d6d71f1adef289d672 (diff)
downloadpx4-nuttx-18161f32055969218532f2174e577e4b888b29f1.tar.gz
px4-nuttx-18161f32055969218532f2174e577e4b888b29f1.tar.bz2
px4-nuttx-18161f32055969218532f2174e577e4b888b29f1.zip
task_create now dup's all open descriptors
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@789 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/ChangeLog3
-rw-r--r--nuttx/Documentation/NuttX.html5
-rw-r--r--nuttx/sched/sched_setupidlefiles.c26
-rw-r--r--nuttx/sched/sched_setuptaskfiles.c21
4 files changed, 33 insertions, 22 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index c1c5ac946..da542dfe3 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -378,4 +378,7 @@
* Add pipe() and test for both pipes and fifos
* Attempts to open a FIFO will now block until there is at least one writer
* Add test/Fixed errors in FIFO reader/writer interlocks
+ * Removed limitation: task_create() was only dup'ing 3 file descriptors (now
+ dups all open file descriptors).
+ * Added a test for redirection of stdio through pipes
diff --git a/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html
index cc3f86c83..19c70498e 100644
--- a/nuttx/Documentation/NuttX.html
+++ b/nuttx/Documentation/NuttX.html
@@ -8,7 +8,7 @@
<tr align="center" bgcolor="#e4e4e4">
<td>
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
- <p>Last Updated: July 26, 2008</p>
+ <p>Last Updated: July 29, 2008</p>
</td>
</tr>
</table>
@@ -1027,6 +1027,9 @@ nuttx-0.3.12 2008-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
* Add pipe() and test for both pipes and fifos
* Attempts to open a FIFO will now block until there is at least one writer
* Add test/Fixed errors in FIFO reader/writer interlocks
+ * Removed limitation: task_create() was only dup'ing 3 file descriptors (now
+ dups all open file descriptors).
+ * Added a test for redirection of stdio through pipes
pascal-0.1.3 2008-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
diff --git a/nuttx/sched/sched_setupidlefiles.c b/nuttx/sched/sched_setupidlefiles.c
index bb9526a63..7ff94674b 100644
--- a/nuttx/sched/sched_setupidlefiles.c
+++ b/nuttx/sched/sched_setupidlefiles.c
@@ -1,7 +1,7 @@
-/************************************************************
- * sched_setupidlefiles.c
+/****************************************************************************
+ * sched/sched_setupidlefiles.c
*
- * Copyright (C) 2007 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Included Files
- ************************************************************/
+ ****************************************************************************/
#include <nuttx/config.h>
@@ -52,15 +52,15 @@
#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0
-/************************************************************
+/****************************************************************************
* Private Functions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Public Functions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Function: sched_setupidlefiles
*
* Description:
@@ -74,7 +74,7 @@
*
* Assumptions:
*
- ************************************************************/
+ ****************************************************************************/
int sched_setupidlefiles(FAR _TCB *tcb)
{
diff --git a/nuttx/sched/sched_setuptaskfiles.c b/nuttx/sched/sched_setuptaskfiles.c
index 2d03a4c4f..eb00f5491 100644
--- a/nuttx/sched/sched_setuptaskfiles.c
+++ b/nuttx/sched/sched_setuptaskfiles.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * sched_setuptaskfiles.c
+ * sched/sched_setuptaskfiles.c
*
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@@ -76,10 +76,10 @@
int sched_setuptaskfiles(FAR _TCB *tcb)
{
-#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_DEV_CONSOLE)
+#if CONFIG_NFILE_DESCRIPTORS > 0
FAR _TCB *rtcb = (FAR _TCB*)g_readytorun.head;
int i;
-#endif /* CONFIG_DEV_CONSOLE */
+#endif /* CONFIG_NFILE_DESCRIPTORS > 0 */
int ret = OK;
#if CONFIG_NFILE_DESCRIPTORS > 0
@@ -104,15 +104,20 @@ int sched_setuptaskfiles(FAR _TCB *tcb)
}
#endif /* CONFIG_NSOCKET_DESCRIPTORS */
-#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_DEV_CONSOLE)
+#if CONFIG_NFILE_DESCRIPTORS > 0
/* Duplicate the first three file descriptors */
if (rtcb->filelist)
{
- for (i = 0; i < 3; i++)
+ for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++)
{
- (void)files_dup(&rtcb->filelist->fl_files[i],
- &tcb->filelist->fl_files[i]);
+ /* Check if this file is opened */
+
+ if (rtcb->filelist->fl_files[i].f_inode)
+ {
+ (void)files_dup(&rtcb->filelist->fl_files[i],
+ &tcb->filelist->fl_files[i]);
+ }
}
}
@@ -121,7 +126,7 @@ int sched_setuptaskfiles(FAR _TCB *tcb)
ret = sched_setupstreams(tcb);
#endif /* CONFIG_NFILE_STREAMS */
-#endif /* CONFIG_NFILE_DESCRIPTORS && CONFIG_DEV_CONSOLE */
+#endif /* CONFIG_NFILE_DESCRIPTORS */
return ret;
}