diff options
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/ChangeLog | 3 | ||||
-rw-r--r-- | nuttx/Documentation/NuttX.html | 5 | ||||
-rw-r--r-- | nuttx/sched/sched_setupidlefiles.c | 26 | ||||
-rw-r--r-- | nuttx/sched/sched_setuptaskfiles.c | 21 |
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 <spudmonkey@racsa.co.cr> * 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 <spudmonkey@racsa.co.cr> 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; } |